Solved

Creating a date range formula

Posted on 2008-06-24
10
937 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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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
 
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
How to increase the row limit in Jasper Server.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

840 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