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!

Date > than another Date

Status
Not open for further replies.

Crystalguru

Technical User
Oct 4, 2001
303
0
0
US
I have a formula that says
max(moveout_date)>max(apply_date)

The formula returns a true or false depending on the values.

For example:
I have two date fields from my database.
01/09/2003 max(apply_date)
and
3/02/2003 max(moveout_date)
Returns: True

BUT,this one date field is giving me problems
01/09/2003 max(apply_date)
and
12/02/2002 max(moveout_date)
Returns: FALSE...now forgive me if I seem a little crocked in the head but isn't 12/02/2002 LESS THAN 2003???

Why is this happening?

 
The first thing that comes to mind is that your field is a string and not adate fields.

Mike
 
Hmmm....

Maybe I'm crocked in the head too, but I think your program is doing what you want it too

max(moveout_date)>max(apply_date)
MD 3/02/2003 > AD 01/09/2003 TRUE

MD 12/02/2002 > AD 01/09/2003 FALSE

Seems okay to me, unless it's in DDMMYY format in which case the first one should be false too.

Am I missing something, or has Friday afternoon gotten to you? :eek:)

Rodger
 
Try using the date value function on both dates to make sure that it is comparing them as dates.

max(DateValue(moveout_date)) > max(DateValue(apply_date))

~Brian
 
These formulas are looking at the max of the whole report, not of each group, so make sure you are taking that into account. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Guide to Crystal in VB
- tek@kenhamady.com
 
Ok Kieso, you caught me. I think it was a friday and it had been a really long week.

max(moveout_date)>max(apply_date)
MD 3/02/2003 > AD 01/09/2003 TRUE

MD 12/02/2002 > AD 01/09/2003 FALSE

When you look at it like this it makes sense. ARGH!

I did do some additional grouping for the dates and that seems to help with the max dates.

Thanks all that helped!

Do you ever look at a report so long it starts looking like cave-man drawings?



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top