Solved

Creating a date range formula

Posted on 2008-06-24
10
939 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Independent Software Vendors: 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!

 
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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.

Question has a verified solution.

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

Suggested Solutions

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…
Hello, In my precious Article  (http://www.experts-exchange.com/Database/Reporting/A_15280-Create-Project-in-Microstrategy-Part-I.html)we saw the Configuration part for Microstrategy which included Metadata Creation and DataSource Preparation as …
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

733 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