Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

If Date is before then Null?

Status
Not open for further replies.

Yustrn

Instructor
Jun 19, 2002
42
US
Using Crystal 10 and I need to fiqure out a formula where if the print date of my report is before one of the dates my report is pulling then the field needs to be blank. For example.


I have someone who has placed orders into the future. I have orders from them in Dec 5 2006, Dec 5 2007 Dec 5 2008 December 5 2009. We'll say my report run date (print date is December 10)

The table I'm using pulls all orders by the customer. So for this column is there a way to say If print date is greater than order date then order date should be null?
 
The format would be like this.

if{Datefield1}<{Datefield2} then " " else {Datefield1}

This means, if the date you are deciding whether to print or not is before the deciding date, then print nothing. Otherwise, if the date is the same as or later than the deciding date, then print it.
 
I think you may want this to be:


if CurrentDate < {table.orderDate} then
date(0,0,0)
else
{table.orderDate}


Andy
 
then again, if the 'print date' is a date in the database, not the date you are printing this report then:

if {table.printDate} < {table.orderDate} then
date(0,0,0)
else
{table.orderDate}

Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top