Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date Automation

Status
Not open for further replies.

TEM3

Technical User
Dec 6, 2004
324
US
The follow formula determines the number of pending assignments (PendCnt) for any particular date (DDATE):

if ( (IsNull({ALL_ASSIGNMENTS.Date Completed})) or ({ALL_ASSIGNMENTS.Date Completed} > DDATE) and
(Date({ALL_ASSIGNMENTS.Date Assigned}) <= DDATE) then PendCnt := PendCnt + 1

I would like to get an historical snap shot of the number of pending assignments over the past couple years for a particular day of each month. Since each calendar month has a 15th, I want to automate the report so that, say, DDATE starts at 1/15/2002 and runs for each 15th day of each month to the present.

What would be the best way to start DDATE at 1/15/2002, run the formula and report PendCnt, increment DDATE to 2/15/2002, rerun and report, etc. until 1/15/2006??
 
Did you format the display formula to can grow? What should the figures be?

The {@calc} formula will show the current value of the running total in the details section, so what you are showing doesn't look like a problem to me. Place this next to your two table dates, and see if it is calculating correctly, adding one for each record that meets your criteria.

I would have to see how you implemented the other two formulas to know what else might be going on. Again, please copy them into the thread.

-LB
 
Will do (all your suggestions). Tell me (teach me) this:

What would the simple CR8.5 syntax be to build a datevar from three numbervar's: a year, a month and a day??

I want to play around a little to try to understand what is taking place......
 
This does not work. Am I close??

numbervar ryear := 2006;
numbervar rmonth := 1;
numbervar rday := 4;

shared datevar RptDate := date((totext(rmonth)) + "/" + (totext(rday)) + "/" + (totext(ryear)));
 
datvar MyDate := cdate(year({table.date},month({table.date}),day({table.date})

Or replace the year/month/day functions with your variables.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top