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!

show "NOT ENTERED" if ther is no date entered 1

Status
Not open for further replies.

cjbrown815

IS-IT--Management
Mar 2, 2006
525
US
Hi,
I have a date feild as a group and I want to display "NOT ENTERED" if there is no date entered. Here's my formula, its not working thanks

IF IsNULL (GroupName ({SAMPLE.DATE3}, "weekly")) then "NOT ENTERED" else
(GroupName ({SAMPLE.DATE3}, "weekly"))

-CJ

SQL2005// CRXIr2// XP Pro

"Progress lies not in enhancing what is, but in advancing toward what will be"
-KHALIL GIBRAN 1883-1931
 
You did not explain what was 'not working' but I suspect a type mismatch.
In a Crystal formula, the datatypes returned must be the same;in your case you are trying to return either a string and a date.
Convert the Date to its text form and it should wotk ( Use the ToText function)



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
The field is blank and not displaying "NOT ENTERED" I tried your recommendation and it is not working. Here is my formula

IF IsNULL(GroupName ({SAMPLE.DATE3}, "daily")) then "NOT ENTERED" else
ToText(GroupName ({SAMPLE.DATE3},"daily"))

-CJ

SQL2005// CRXIr2// XP Pro

"Progress lies not in enhancing what is, but in advancing toward what will be"
-KHALIL GIBRAN 1883-1931
 
A couple of things:
Is the field an actual DATE or DATETIME type or a text type that hold date-like data?

Try testing for blanks and NULLS ( not the same in some database engines):
Code:
IF IsNULL(GroupName ({SAMPLE.DATE3}, "daily")) OR TRIM(GroupName ({SAMPLE.DATE3},"daily")) = ""
then "NOT ENTERED" 
else
 ToText(GroupName ({SAMPLE.DATE3},"daily"))



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Sorry about that, its a DATETIME type.

The formula you provided did not return anything. I have the dates showing, there is only one null value. I'm pretty sure the blanks and nulls are the same in the DB, its a SQL 2008 database

thanks

-CJ

SQL2005// CRXIr2// XP Pro

"Progress lies not in enhancing what is, but in advancing toward what will be"
-KHALIL GIBRAN 1883-1931
 
Ha,
I used your formula, removed the group and kept the date field, entered it in the group expert under options then "Use formula as group name" and it's working. :)

I was trying this in the display string :)

thanks a bunch

-CJ

SQL2005// CRXIr2// XP Pro

"Progress lies not in enhancing what is, but in advancing toward what will be"
-KHALIL GIBRAN 1883-1931
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top