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

Pulling Time from DATETIME field

Status
Not open for further replies.

JoyCR9

MIS
Jan 13, 2004
70
CA
My tables store 'create date' as a DateTime field. eg: 2004-06-21 10:55:16PM

I want to do an if statement that basically says:
if the action was created between 5:01PM and 5:59AM
then "print text"

How can I do this? Crystal Reports Version 9.

 
Hi,
Look for the function called TimeValue().
When given a DateTime field, it returns the Time portion only ( at least in 8.5)

[profile]
 
Thanks. I ended up doing the following:

If CTime({SERVICE_CALL.CREATE_DT})in Time(#05:01:00PM#) to Time(#11:59:59PM#)
Then
"ON CALL-AFTER HOURS"
else
If CTime({SERVICE_CALL.CREATE_DT})in Time(#12:00:00AM#) to Time(#05:59:59AM#)
Then
"ON CALL-AFTER HOURS
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top