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

Filling text box based on isnull

Status
Not open for further replies.

Imbriani

Programmer
Jan 9, 2004
195
US
Hi again,

I am using CR XI for a report pulling from an MSAccess DB. I have a text box that I want to fill with the text "Germination to follow" based on whether or not a data/time field in the DB is or is not null. I have tried the following formula:

If Isnull ({GermReadings.FinalGermDate}) then
"**Germination will follow"
Else
" "

At this time, the GermReadings.FinalGermData field is empty, so the text should appear, but it does not. I have read that there are some problems with using the IIF function with Crystal Reports and nulls, but does anyone have any idea of why this won't work? This seems like a very simple task and some other functions of this report will be developed based on this same premise, so any help will be appreciated.

kathy
 
Try this

If Isnull ({GermReadings.FinalGermDate})=TRURE then
"**Germination will follow"
Else
"
 
Hi Mintman,

I get an error that says "the formula result must be a boolean".

Is there something special about this being a date/time field that is complicating things?


Kathy
 
Oh Im sorry I dint see that was a time field.Try this
If Isnull (ToCHAR({GermReadings.FinalGermDate}))=TRURE then
"**Germination will follow"
Else
" "

Not sure this will work. But give it a shot. COnvert the date field into string format first.Thanks.
 
This time is says "the ) is missing" although it looks like they're all there to me.

Would using something like:

If ({GermReadings.FinalGermDate}) = (NullDate,Nulltime) then
"**Germination will follow"
Else
" "

work? I found the (NullDate,NullTime) info in the help menu, but I'm not sure I understood it correctly.

Kathy
 
Yeah it should work, but are you having the time field too?,
If ({GermReadings.FinalGermDate}) = (NullDate,Nulltime) then
"**Germination will follow"
Else
" "

You mentioned above statment, but you are using only DateField not Both Date and time field. So i guess you have to use
If (Date({GermReadings.FinalGermDate})) = (NullDate) then
"**Germination will follow"
Else
"
 
Hi,
Try:

If
(
Trim({GermReadings.FinalGermDate}) = ""
OR
IsNull({GermReadings.FinalGermDate})
OR
{GermReadings.FinalGermDate} = Date(0,0,0)
)
Then
"**Germination will follow"
Else
""




[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Hi guys,

I tried this, based on some of your suggetions and it works!!


If Cstr({GermReadings.FinalGermDate})= "" then
"**Germination will follow"
Else
" "

I did have to change the data from date/time to string.
Will this be bulletproof and should I put the Trim in and, if so, how?

kathy
 
If
(
Trim( Cstr({GermReadings.FinalGermDate})) = ""
OR
IsNull( Cstr({GermReadings.FinalGermDate}))
OR
Date{GermReadings.FinalGermDate} = Date(0,0,0)
)
Then
"**Germination will follow"
Else
 
Thank you so much for your help and patience. This information has been more helpful than you'll ever know!

Kathy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top