Print Page | Close Window

Isnull in SQL expression

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=22768
Printed Date: 02 May 2024 at 2:12am


Topic: Isnull in SQL expression
Posted By: $$Dr
Subject: Isnull in SQL expression
Date Posted: 02 May 2019 at 5:50am
What does this  statement mean when included in a record selection statement?

{fn IFNULL(POHD.Job,'')}

the data field could be different in similar expressions.



Replies:
Posted By: DBlank
Date Posted: 02 May 2019 at 6:16am
not sure what your datasource is but the IFNULL should,I think, be basically the same as SQL's ISNULL()
which returns a default value for a null field
so if your table is
LETTER AGE
A      1
B      NULL
C      4
and you select ISNULL(table.age,0) it returns 1 for row A, 0 (instead of null) for row B and 4 for row C


Posted By: $$Dr
Date Posted: 02 May 2019 at 6:31am
Thanks, this statement was preventing a report from returning results in one database company vs another with results being displayed in old company but not new. (recent merge of 4 companies into a single company.)


Posted By: DBlank
Date Posted: 02 May 2019 at 6:50am
it might be a custom function in that DB


Posted By: lockwelle
Date Posted: 02 May 2019 at 10:41am
looking online...ifnull is mysql's nullif as DBlank alluded to.



Print Page | Close Window