Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 964
  • Last Modified:

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.

0
SAW56
Asked:
SAW56
1 Solution
 
analliahCommented:
on your select criteria,
 {date.field} in {?Startdate} to {?endDate}

?startdate
?enddate is your parameter

0
 
analliahCommented:
create your paramters to be datetime
0
 
analliahCommented:
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
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
mlmccCommented:
If you always want that range simply use a formula like this for the select expert


 {date.field} in DateTime(CurrentDate - 1,Time(14,00,00)) to DateTime(CurrentDate,Time(04,00,00))

mlmcc
0
 
bdreed35Commented:
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))
0
 
bdreed35Commented:
I guess I should have refreshed the page before posting.  

mlmcc, I guess we had the exact same solution.
0
 
bdreed35Commented:
Except I had the times screwed up...
0
 
SAW56Author Commented:
Thanks for all your help....it worked perfectly
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now