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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Variables and dates - missing on nextdate

Status
Not open for further replies.

agray123

Technical User
Mar 4, 2002
110
US
I have a formula :

if {@variablenextdate}>{TRAVEL.ENDDATETIME}then datediff('d', {TRAVEL.BEGINDATETIME},{TRAVEL.ENDDATETIME}) else
if{@variablenextdate}< {TRAVEL.ENDDATETIME}then DateDiff ('d',{EXPENSEDETAIL.ARRIVEDATETIME} ,{TRAVEL.ENDDATETIME} )else
DateDiff ('d',{EXPENSEDETAIL.ARRIVEDATETIME} ,{@variablenextdate} )

Where variablenextdate is:

dateTimeVar next_date :=((next({EXPENSEDETAIL.ARRIVEDATETIME})));

The problem is that I get a blank on the last record - where there is no other arrive date available - I cannot even code for date(0,0,0) - what am I missing?
 
Since it is your last record your variable, dateTimeVar next_date :=next({EXPENSEDETAIL.ARRIVEDATETIME});, will not contain data since there is no next({EXPENSEDETAIL.ARRIVEDATETIME}).

You could use the following in your formula to set your variable:

if onlastrecord then
dateTimeVar next_date :=date(0,0,0)
else
dateTimeVar next_date :=next({EXPENSEDETAIL.ARRIVEDATETIME});





Mike
 
perfect - thanks a million - I have been staring at this for too long - now If I generate a number here - and multiply it by a cost amount that has been grouped - how can I get a summary of this?

Should i pass it from a subreport back to the main report?

(i want to multiply this by the subsistence rate and hotel rates for 2 separate totals.)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top