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

if statement for datetime 1

Status
Not open for further replies.

grom71

IS-IT--Management
Oct 23, 2003
56
GB
Hi,
I think this is a simple one, but my brain is dead this morning.
I have a date/time field called {DIAGNOSI.END_DATE}

I need an IF statment to say is the date is = 01/01/1900 then "" else {DIAGNOSI.END_DATE}. The rougue date needs stripping out...to give a blank field.

I can't even get this basic of statements to work !

Please help me !
Steve

Authorised re-seller of CRD (a powerful scheduling tool for automating Crystal reports)
Visit for 10% discount.
 
You are dealing with two data types.

If you are just working on suppressing it in the canvas you can go to the conditional formatting and suppress using

Code:
currentfieldvalue=#1/1/1900#

That's a right-click on the formula on the canvas, then select 'format field', 'common', and the x-2 next to suppress. I include all that just in case.

Otherwise you have to convert the date to a text using totext.

Code:
if {DIAGNOSI.END_DATE}= #01/01/1900# then "" else totext({DIAGNOSI.END_DATE},"MM/dd/yyyy").

Good luck with the brain-dead thing. Been there.
 
Went for the latter option thanks...
My brain is starting to wake up now.. enjoy your weekend
Steve

Authorised re-seller of CRD (a powerful scheduling tool for automating Crystal reports)
Visit for 10% discount.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top