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!

Extracting time from date time

Status
Not open for further replies.

rgibson975

Technical User
Sep 15, 2008
3
US
I have a date time field from an input clock with the following format record one 1/18/09 9:51am record two 1/18/09 3:30pm.

I want to two categories Breakfast_Lunch clock-in time earlier than 3:00pm and Dinner clock-in time later than or equal to 3:00

How do I strip out the Date portion so I can work with the time only?

thanks in advance for your help.

ron
 
Try something like
Code:
DatePart ("h", {your.date1})
This will give you the hour: you can get the minute using "n".

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
if Time({table.date}) < time(15,0,0) then
"Breakfast-Lunch"
else
"Dinner
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top