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

How to conditionally suppress date

Status
Not open for further replies.

lawsonreports

Technical User
Jun 19, 2003
13
US
I have a date field that occasionally has a SQL server default value of 01/01/1753 in it (no nulls allowed, yet the application does not require the date to be entered!). I want to show this value as blank on a report. After I had no success figuring out a Crystal syntax formula, a co-worker provided this Basic syntax for my formula, and it works. So my question is - can this be done in the Crystal syntax? I was trying to use the IIF , and I got no where.

Here is the Basic code that works:

If {VBPTENTLI.VB_END_DT_LI} = #1/1/1753# Then
Formula = True
Else
Formula = False
End if


 
Right click the {VBPTENTLI.VB_END_DT_LI} field and select format field->X-2 next to Suppress and use :

{VBPTENTLI.VB_END_DT_LI} = cdate(1753,1,1)

This will now suppress it if it equals 1/1/1753

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top