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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Comparing dates from different fields

Status
Not open for further replies.

tj007

IS-IT--Management
Mar 14, 2003
129
0
0
US
Hi I am tying to compare dates from two fields I would like to show all records that have a INREF_PODATE that is greater than the INV_DATE. I am trying to show when payments were made before an invoice was received.


{invoice_podate.INV_DATE} >={invoice_podate.NREF_PODATE}
 
In Crystal 8.5, just put a test in your report selection formula. (The one you show is the opposite of the one you describe, though.)

Alternatively you can set a suppression formula in your detail section and prevent records being shown if they have the wrong date.

With dates, you also need to make allowance for one date or both being null.

Madawc Williams
East Anglia, Great Britain
 
I have supressed other columns, however what is the formula for showing all records for {invoice_podate.INV_DATE}column which comes before >={invoice_podate.NREF_PODATE} column for the same record?
 
Do I need to convert the date field to a string then do a comparison?
 
If the field is not defined as a date, you'll need to convert it. See the CDate (string) command.

Madawc Williams
East Anglia, Great Britain
 
Thank you I changed the date to a string and I was able to obtain the correct information.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top