Print Page | Close Window

RecordSelectionFormula for 24 hrs. data

Printed From: Crystal Reports Book
Category: Crystal Reports .NET 2003
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=13436
Printed Date: 19 Apr 2025 at 9:32pm


Topic: RecordSelectionFormula for 24 hrs. data
Posted By: umesh.chape
Subject: RecordSelectionFormula for 24 hrs. data
Date Posted: 07 Jun 2011 at 11:18pm
Hi All,

I Generated report to show data of last 24 hours .

I am using below RecordSelectionFormula ,

rpt.RecordSelectionFormula = "cdate({tbDoc.ArrivalDate})=CDate('" + 2011-06-07 + "') and CTime({tbDoc.ArrivalTime})>= CTime('" + 9:00 PM+ "')   or cdate({tbDoc.ArrivalDate})=CDate('" + 2011-06-08 + "') and CTime({tbDocumentDetails.ArrivalTime})>= CTime('" + 9:00 PM+ "')"

But it reocrd time is 12:00 Am for date 2011-06-08 then it is not showing the reocrd..

Please help me .



Replies:
Posted By: Dewald
Date Posted: 07 Jun 2011 at 11:59pm
you could try cdatetime(ArrivalDate & ' ' & ArrivalTime) >= dateadd ("h",-24,currentdatetime)

-------------
Dewald Botha
http://www.ITClarity.co.za



Print Page | Close Window