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!

Date/Time Formula in Record Selection

Status
Not open for further replies.

ToneV

MIS
Oct 29, 2003
19
US
I am using Crystal 10 and am trying to write a formula in the record selection. I currently have a parameter, but am trying to do away with it for the report to run automatically in Enterprise without having to update the parameter everyday. I need to select the data from yesterday starting at 7am until the current day at 7am. I have the date figured out, but not sure how to incorporate the time. Here is my existing code:

date({Unit.ULCATIME}) in currentdate -1 to currentdate

Thanks!
 
I use the following in Crystal 8.5 but I don't see why it would not work for you. This assumes that your date field is a datetime value.

Code:
{Unit.ULCATIME} in [datetimevalue(currentdate - 1,timevalue(07,00,00)) to_ datetimevalue(currentdate,timevalue(07,00,00))]

Cheers,

-LW
 
Try this instead:

{Unit.ULCATIME} in dateadd("h",-17,currentdate) to dateadd("h",7,currentdate)


~Brian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top