Link to home
Start Free TrialLog in
Avatar of SAW56
SAW56Flag for United States of America

asked on

Creating a date range formula

I am creating a crystal report and need to know how to pull a date range of 2:00PM yesterday to 4:00AM Current Date.

Avatar of analliah
analliah
Flag of United States of America image

on your select criteria,
 {date.field} in {?Startdate} to {?endDate}

?startdate
?enddate is your parameter

create your paramters to be datetime
without parameter:
 on your select expert click new then choose your date.field
choose the is between and choose your start date and end date
date.jpg
ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
If you simply want to always run from 4 pm yesterday to 2 am today, then you can use this logic in your record selection formula:

{table.datetimefield} in datetime(currentdate-1,time(16,0,0)) to datetime(currentdate,time(2,0,0))
I guess I should have refreshed the page before posting.  

mlmcc, I guess we had the exact same solution.
Except I had the times screwed up...
Avatar of SAW56

ASKER

Thanks for all your help....it worked perfectly