Solved

Creating a date range formula

Posted on 2008-06-24
10
931 Views
Last Modified: 2012-05-05
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
Comment
Question by:SAW56
10 Comments
 
LVL 5

Expert Comment

by:analliah
ID: 21858524
on your select criteria,
 {date.field} in {?Startdate} to {?endDate}

?startdate
?enddate is your parameter

0
 
LVL 5

Expert Comment

by:analliah
ID: 21858531
create your paramters to be datetime
0
 
LVL 5

Expert Comment

by:analliah
ID: 21858591
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
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 21858747
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 28

Expert Comment

by:bdreed35
ID: 21858831
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
 
LVL 28

Expert Comment

by:bdreed35
ID: 21858844
I guess I should have refreshed the page before posting.  

mlmcc, I guess we had the exact same solution.
0
 
LVL 28

Expert Comment

by:bdreed35
ID: 21858858
Except I had the times screwed up...
0
 

Author Comment

by:SAW56
ID: 21867201
Thanks for all your help....it worked perfectly
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

1. Set up your parameter at the report level as usual, check the box Multi-value, and set the Data Type to String 2. Set the Stored Procedure Parameter to varchar(max)  --<---- This part here is the key to it's success Example:    @cst_key var…
Hi, In my previous Article  (http://www.experts-exchange.com/Database/Reporting/A_15199-Introduction-to-Microstrategy.html)I discussed some basic understanding of Microstrategy that how we can get in Intro of Microstrategy (MSTR). Now it's tim…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now