Print Page | Close Window

Date/Time Suppression

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=17597
Printed Date: 06 May 2024 at 11:09pm


Topic: Date/Time Suppression
Posted By: south
Subject: Date/Time Suppression
Date Posted: 19 Sep 2012 at 8:56am

I have added a date/time field and text box in the report I am working on.  I would like to suppress the text box when there is no date/time.  I have tried the format editor - common tab - suppress - and used a formular to suppress if there is no date.  It does not work! Yet no date is listed on the date field.  ??




Replies:
Posted By: lockwelle
Date Posted: 19 Sep 2012 at 9:02am
the supression formula would be something like:
 
isnull({table.datetime})
 
that should do it
 
HTH


Posted By: south
Date Posted: 19 Sep 2012 at 9:20am
I already tried that...it doesn't work. 


Posted By: DBlank
Date Posted: 19 Sep 2012 at 10:13am
are these all on the same detail row or are you doing summary level checking?
is it really a datetime field or a string that is formatted like datetime?


Posted By: Sastry
Date Posted: 19 Sep 2012 at 8:50pm
Hi..
 
In suppress formula editor.. On top middle there is drop down box, choose Default values for Null and make the following change in your formula :
 
isnull(table.field) or {table.field} = " "


-------------
Thanks,
Sastry


Posted By: south
Date Posted: 20 Sep 2012 at 3:15am

I have it in the group editor and it is a datetime field.  There must be some kind of default date but when I look in the table that the information is coming from it's blank. I can not believe something that I thought would be so easy ends up being so difficult!



Posted By: south
Date Posted: 20 Sep 2012 at 3:18am
I did the formula and it says that there is an error in the formula - i highlights  "" and says a datetime is required here.


Posted By: DBlank
Date Posted: 20 Sep 2012 at 3:40am
What do you mean by "I have it in the group editor'?


Posted By: south
Date Posted: 20 Sep 2012 at 4:02am

Sorry...I meant I have it in the group header not in the detail section of the report.



Posted By: DBlank
Date Posted: 20 Sep 2012 at 4:19am

The formula you wrote evaluates per row (detail section).

Since you are palcing it in a group header it is only evaluating for the first row in the group.
 
try to do some trouble shooting
make a formula field as lockwelle suggested usingh
isnull({table.datetime})
place it on the detail section
it should return True (if the fiel sis null) or False (if the field has a value).
Is this working as you expect?


Posted By: south
Date Posted: 20 Sep 2012 at 4:44am

It runs false on all, even the ones that have no date/time.  Is there a way to find out what the default date is?  I don't know if this helps but I have an SQL server and the date field that this table is getting information from is a drop down calandar. Thank you for you help!!

I think I am going to give up!


Posted By: DBlank
Date Posted: 20 Sep 2012 at 5:10am
try
table.datefield = date(1900,1,1)
 
and see if you get any True values returned


Posted By: south
Date Posted: 20 Sep 2012 at 8:15am
All false


Posted By: DBlank
Date Posted: 20 Sep 2012 at 8:21am
what number do you get on the 'blank' rows when you do this
 
datediff('d',table.datefield,currentdate)


Posted By: lockwelle
Date Posted: 20 Sep 2012 at 8:32am
you could also try totext({table.field}, "MM/dd/yyyy"}


Posted By: south
Date Posted: 20 Sep 2012 at 9:00am
When I did the totext I got  12/31/-471


Posted By: DBlank
Date Posted: 20 Sep 2012 at 9:16am
interesting
i did not think negative year values were allowed...
It wont accept date(-471,12,31) as a value so maybe try
 
table.datefield < date(1900,1,1)


Posted By: south
Date Posted: 20 Sep 2012 at 9:29am

It worked Clap I was ready to give up a long time ago, and I would've if it wasn't for all your help!!! Thank you so much!!!!!!!!!!!




Print Page | Close Window