Normal Topic "Flag" a date range (Read 588 times)
drastixnz
Full Member
***
Offline


A Newbie....

Posts: 146
Location: New Zealand
Joined: Nov 29th, 2006
"Flag" a date range
Aug 26th, 2007 at 10:23pm
Print Post Print Post  
Hi All,
  I don't know if that is the right title but i will explain here.

I have two fields one call "date received" and the other called "date due out" when a set of plans come in they have a date assigned to them called "date received" and 10 working days afterwards are when they are due out, "date due out" I want to be able to during those 10 days, it to be flagged "on schedule" and when it  goes over the due date, the flag needs to go to, Overdue.

I have been trying to work it out, but now I have found that wall again.
  
Back to top
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: "Flag" a date range
Reply #1 - Aug 27th, 2007 at 12:16am
Print Post Print Post  
Create an unbound text element named "Status"
Put something like this in the program section, OnFormEnter.

If @Date <= DateDueOut then Status ="On Schedule"
Else {
If @Date>DateDueOut then Status = "OverDue"

----------------------------------
But what do you do after delivery?  Will always show overdue.

Suggest adding another date element, "DateShipped".  Make the DueDate calculated automatically from DateReceived, Read Only, and change @Date in the the program above to DateShipped.

Will look like this:
If DateShipped <= DateDueOut then Status = "On Schedule"
If @IsBlank(DateShipped) and DateDueOut<@Date, then Status = "Overdue"
If DateShipped > DateDueOut then Status = "Late Delivery"

(Sample code here is untested)
-----------------
This will also allow you to get statistics on how many shipments were on time, days late, days after receipt, etc.  Avg number of days late, etc. can be calculated.
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
drastixnz
Full Member
***
Offline


A Newbie....

Posts: 146
Location: New Zealand
Joined: Nov 29th, 2006
Re: "Flag" a date range
Reply #2 - Aug 27th, 2007 at 1:18am
Print Post Print Post  
Thanks bob

I was just wondering if i am able, to fill the Element with a colour once it came over due?
  
Back to top
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: "Flag" a date range
Reply #3 - Aug 27th, 2007 at 2:38am
Print Post Print Post  
YES, with Version 2.  See ATTRIBUTE command, Programming Guide, p 169

OnFormEntry:

//Overdue
If DueDate<@Date then {
       Attribute(DueDate,ATTR_ID_TEXT_RGB_COLOR,"255,0,0")
       }

//On Time
If DueDate >=@Date then {
      Attribute(DueDate,ATTR_ID_TEXT_RGB_COLOR,"0.200.255") }
      }

ForceRedraw()
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: "Flag" a date range
Reply #4 - Aug 27th, 2007 at 1:31pm
Print Post Print Post  
You can also use the RGBColor() Sbasic command to change the color of an element in Version 1.x

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged