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

I am trying to evaluate an expressi 1

Status
Not open for further replies.

Hillary

Programmer
Feb 15, 2002
377
US
I am trying to evaluate an expression for some records in Crystal. I can't get it to work so I went back to a basic expression and I can't get that to work either!

If I place Date({LABOR_TICKET.TRANSACTION_DATE}) in my report I get the Transaction Date returned; for example 7/8/03 is returned. If I change the formula to If Date({LABOR_TICKET.TRANSACTION_DATE}) = Date(07/08/2003) then "True" else "False" the report returns False for all lines (even the 7/8/03 lines). I expect to see True where the Transaction Date is 7/8/03. Can anyone help with this expression so True is returned for lines matching 7/8/03?

Transaction Date is coming from a database that stores the field as DateTime.

Thanks for your help.



Hillary
 
The correct date syntax for July 8 is:

If Date({LABOR_TICKET.TRANSACTION_DATE}) = Date(2003,07,08) then True else False

I think the problem was your use of the "/" instead of a comma--Crystal then read the three numbers as 07 divided by 08 divided by 2003, i.e., as a number to be translated into a date with the date function. Also please note the correct order of the year, month, and date fields in the function.

-LB
 
This is good to know. Thanks! I had tried the date in the order you have it but I used the slash instead of the comma.

Thanks again!

Hillary
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top