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

I am trying to store the previous v

Status
Not open for further replies.

merrittr

MIS
Nov 6, 2000
4
CA
I am trying to store the previous value of a fielsd in a
variable so that I can compare the current records value to
a previous value and if the previous value lastEnd < WORK_FACILITY_USAGE.BOOKING_START then print out
a bunch of fields currently it balks at : -- saying a dtatime is required here |
|
v
if ({WORK_FACILITY_USAGE.BOOKING_START} > lastEnd;)

report header:
fomula field (@INIT):

Shared timeVar lastEnd := Time(&quot;12:00am&quot;);


details B:
formula field (@startGTMaxOfEnd)

WhilePrintingRecords;
Shared timeVar lastEnd;
if ({WORK_FACILITY_USAGE.BOOKING_START} > lastEnd;)
then
timeVar lastEnd := {WORK_FACILITY_USAGE.BOOKING_END};
ToText
({FACILITY_MASTER.TITLE} + &quot; &quot; + {@Start Time} + &quot; -> &quot; + {@End Time})
 
Is {WORK_FACILITY_USAGE.BOOKING_START} a datetime, or a time value? The error message would indicate that it is a datetime value. Malcolm
wynden@telus.net
November is &quot;be kind to dogs and programmers&quot; month. Or is that &quot;dogs or programmers&quot;?
 

Hmm you are right about WORK_FACILITY_USAGE.BOOKING_START
it is a DateTime value so I changed
the init fomula to :
DatetimeVar lastEnd := DateTime(Cdate(&quot;Dec. 31,1999&quot;));

but the formula in the details section still complains
about the lastEnd variable saying:

a number currency amount,boolean,date, time, date-time or string expected here???

if ({WORK_FACILITY_USAGE.BOOKING_START} > lastEnd;)
 
change
if ({WORK_FACILITY_USAGE.BOOKING_START} > lastEnd;)
to
if ({WORK_FACILITY_USAGE.BOOKING_START} > lastEnd)
Malcolm
wynden@telus.net
November is &quot;be kind to dogs and programmers&quot; month. Or is that &quot;dogs or programmers&quot;?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top