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!

Formatting date issue

Status
Not open for further replies.

mart10

MIS
Nov 2, 2007
394
GB
I am using CR 10


I have data (field in SQL - {AccountMore.GroupJoinDate}), when browsed in Crystal it says its a date but isnt! It holds as a number and the start date in system is 31st Dec 1961

So I use date(1961,12,31)+{AccountMore.GroupJoinDate} and format it to get nice dtaes eg 15-Aug-1999

But if no date held in system it holds it as 0 So how can I suppress if 0. I tried:

If {AccountMore.GroupJoinDate} = 0 then "" else
date(1961,12,31)+{AccountMore.GroupJoinDate}

but it doesnt like it and says string required as I mixing types

 


You can plug in a dummy date and suppress the field if the GroupJoinDate is 0:

If {AccountMore.GroupJoinDate} = 0 then date(1900,1,1)
else
date(1961,12,31)+{AccountMore.GroupJoinDate}


Then use this formula to suppress the field:

{AccountMore.GroupJoinDate} = 0



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top