Print Page | Close Window

Crystal Report - How to select Today's date and cu

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=20257
Printed Date: 29 Apr 2024 at 1:36am


Topic: Crystal Report - How to select Today's date and cu
Posted By: HEMREDDY
Subject: Crystal Report - How to select Today's date and cu
Date Posted: 27 Nov 2013 at 10:30am
Hi,
 
How to select records between Today's date and current time - 15 min in Selection Expert?
 
Say the current date and time is 11/27/2013 12.00.00, i want a report to geerate a report showing all records between 11/27/2013 11.45.00 and the current date and time 11/27/2013 12.00.00.
 
Hem Reddy



Replies:
Posted By: kevlray
Date Posted: 27 Nov 2013 at 11:54am
I think you would want a formula something like this:
datediff("m",{somedatetimefield},currentdate) <= 15


Posted By: lolly54
Date Posted: 03 Dec 2013 at 10:03pm
Try adding these two formulas:

Formula 1: ReportTo
currentdatetime

Formula 2: ReportFrom
dateadd('n', -15, {@ReportTo})

You only need to determine the {@ReportTo} date time. {@ReportFrom} will always return a datetime value 15 mins prior to {@ReportTo}.

Then, in your selection section, simply put:
{Record.Open_date} in {@ReportFrom} to {@ReportTo}

Hope this will work for you! :)



Print Page | Close Window