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

Time value from Date time field 1

Status
Not open for further replies.

bhaswar

MIS
Oct 9, 2002
8
IE
I am trying to figure out shift date for the night shift. So if the time is before 8:00 am then it is the night shift of the previous day. So I wrote this formula to do it. But it gives an error on the 3rd line (start of the if) saying "a date-time is needed here"
I don't understand it... need some help urgently.

Thanks
BG

DateVar ShiftDate;
// ShiftDate := {Summary.Date_Time};
if timevalue ({Summary.Date_Time}) <= #07:59:59# then
ShiftDate := Date({Summary.Date_Time}) - 1
else
ShiftDate := Date({Summary.Date_Time});

 
Change the line to:
if timevalue ({Summary.Date_Time}) <= time(07,59,59) then

-Dell
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top