[ACCEPTED]-How do I make this SQL statement return empty strings instead of NULLS?-null
You can use the COALESCE function to avoid getting 4 nulls. Basically it returns the first non-null 3 value from the list.
SELECT COALESCE(dateField, '') FROM Some_Table
This is an ANSI standard, though 2 I have noticed that it isn't available in 1 Access SQL.
You can use CASE:
CASE WHEN MyField IS Null THEN '' ELSE MyField End As MyField
select max(isnull(modifydate, "default date") from scormtrackings where...
will work as long as there is at least one 3 row that satisfies the where clause, otherwise 2 you will still get NULL
select IsNull( max(modifydate), "default_date") from scormtrackings where ...
should work in all 1 cases
select max(isnull(Date,"default date")) .....
This works too... hate to admit how often 4 I use it!!
Declare @LastAccessed varchar(30)
Select 3 @LastAccessed = max(modifydate) from scormtrackings 2
Set @LastAccessed = isnull(@LastAccessed,'')
Select 1 @LastAccessed as LastAccessed
You can use
NVL(<possible null value>,<value to return when arg1 is null>)
More Related questions