Print Page | Close Window

date formula

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=338
Printed Date: 18 May 2024 at 2:22pm


Topic: date formula
Posted By: aleplgr
Subject: date formula
Date Posted: 16 Mar 2007 at 7:46am
Hi! in the Orders table of the xtreme database I'm trying to show all records greater than 05/03/2004, I want to show just the order Id and the Order Date.
To do that I defined the formula  {Orders.Order Date}>= #05/03/2004#
and I formatted the field by rightclicking it and selecting in the Date tab the format I want: DD/MM/YYYY in the fields it shows the example format 01/03/1999 also  shows Day 01, Month 03, Year 1999. And when I run the report without any formula it shows all  the date fields correctlly in this format and in the right order.
 
But when I run the report with the formula  it shows all the records starting from  03/05/2004 Dead
 it should show the order Id 1403 first, this Order has Order Date 05/03/2004, what's happening?
I think it's about the #, I think it does not get the date as a date in the formula...
 
 



Replies:
Posted By: BrianBischof
Date Posted: 16 Mar 2007 at 9:03am
Not sure. It works for me. However, it would be more reliable if you used Crystal's default method of filtering on the data.

{Orders.Order Date}>=DateTime (2005, 03, 01, 0, 0, 0)



-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>


Posted By: aleplgr
Date Posted: 16 Mar 2007 at 9:08am
Thanks, now I'm using this
{Orders.Order Date} in CDate("05/03/2004") to CDate("06/05/2004")
and works



Print Page | Close Window