How to determine if a field is null

I am trying to determine if a field is null or not, but I do not how to do it. I have tried:

[IIf(ds.EntryDate==null, "<no date>", ds.EntryDate)]

and also

[IIf(ds.EntryDate==BNull.Value, "<no date>", ds.EntryDate)]

but both do not work. How can I do it?

Thank you

Comments

  • edited 8:58PM
    Try
    IIf([ds.EntryDate] == null || [ds.EntryDate] is DBNull, "<no date>", [ds.EntryDate])
  • edited 8:58PM
    I have tried your response, but it seems not working. If I click View Data, in the Data panel, I can check that the field is blank.

    I am using:

    [IIf([ds.EntryDate] is DBNull || [ds.EntryDate] == null, "<NULL>", [ds.EntryDate])]

    and I FR prints out 01/01/1001 0:00:00

    I would expect to see <NULL> because the field is null, checked in View Data panel and in other tools.

    I am using Firebird as database, maybe it could be relevant.

    Thank you


  • edited 8:58PM
    I forgot to say that the "Convert null values" option must be off.
  • edited 8:58PM
    It is off
  • edited February 2010
    Ok, here is the correct code:
    [IIf(Report.GetColumnValueNullable("ds.EntryDate") is DBNull, "<NULL>", [ds.EntryDate])]

    You may also use the "NullValue" property of the Text object:
    Text = [ds.EntryDate]
    NullValue = <NULL>

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.