Report Design
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Report Design
Message Icon Topic: HIde specific Date in Data Field Post Reply Post New Topic
Author Message
thummel1
Senior Member
Senior Member
Avatar

Joined: 27 Apr 2012
Location: United States
Online Status: Offline
Posts: 140
Quote thummel1 Replybullet Topic: HIde specific Date in Data Field
    Posted: 27 Apr 2012 at 4:40am
Hi,
I'm new to this site, so please bear with me as I learn the "techspeak" and such! In my Crystal Report (2008 version), I've been asked to "hide", or just make blank, whenever a specific date appears in a column. The Date is 1/1/1700. I thought I could write the following If Then Else statement to hide it:
If{EMPLOYEE.TERM_DATE}=#1/1/1700# then "" else "{EMPLOYEE.TERM_DATE}"
However, I get an error message that says the 'else' section of this statement needs to be a string, and I get it, it's because the 'then' is also a string. So the challenge. What's the best way to essentially hide all dates that appear like 1/1/1700? I'm hoping this is an easy question for more advanced Crystal users. Thanks!
"Press any key to continue. Where's the 'Any' Key?" ~Homer Simpson
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 27 Apr 2012 at 5:20am
change the formula to this
if {EMPLOYEE.TERM_DATE}<>#1/1/1700#then  {EMPLOYEE.TERM_DATE}

That should eliminate having to convert the date to text.
IP IP Logged
thummel1
Senior Member
Senior Member
Avatar

Joined: 27 Apr 2012
Location: United States
Online Status: Offline
Posts: 140
Quote thummel1 Replybullet Posted: 27 Apr 2012 at 7:00am
I tried this and, although I no longer get the error message, the date 1/1/1700 stays on the report. Also, when I added the Else "" at the end it still requires a date/time instead of a string. Stumped.
"Press any key to continue. Where's the 'Any' Key?" ~Homer Simpson
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 27 Apr 2012 at 8:24am
That is odd, I tried the code on one of my databases and it worked fine.  Did you create a formula for the column or are you trying to suppress the field (Format Field, Suppress)?
IP IP Logged
thummel1
Senior Member
Senior Member
Avatar

Joined: 27 Apr 2012
Location: United States
Online Status: Offline
Posts: 140
Quote thummel1 Replybullet Posted: 27 Apr 2012 at 8:59am
I created the formula for the column and I do not want to suppress the field, just the dates that appear like 1/1/1700 in the field. So I would expect the example below that looks like:
01/28/2008
02/01/1996
1/1/1700
1/1/1700
12/15/2009
 
to appear like:
1/28/2008
02/01/1996
 
 
12/15/2009
 
 
"Press any key to continue. Where's the 'Any' Key?" ~Homer Simpson
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 27 Apr 2012 at 9:47am
When I used the formula above, those are basically the results I got.  I am not sure why it is not working for you.
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.