Microsoft
Software
Hardware
Network
Question : Select MAX(ISNULL(variable, 0)) is returning NULL when it should be returning 0
I am trying to select a value before I do an insert.
In the table, I am trying to grab the next available ID, but, it is returning NULL. I am trying to do this:
SELECT MAX(ISNULL(fedexid, 0)) FROM fedex
Since there are no records in the FedEx table, this is returning as NULL. How do I get the above statement to return 0 if it is NULL.
Answer : Select MAX(ISNULL(variable, 0)) is returning NULL when it should be returning 0
try
SELECT ISNULL(MAX(fedexid),0) FROM fedex
Random Solutions
MS Access - how to trap SQL primary key violation error?
Changing the source for a query
HOW to map drives that STAY mapped after user logs off?
Crystal Reports newbie - how to increase text size
users cannot open Tiff files in outlook in a Terminal server enviroment
Need to make some space on server - can I remove PCHEALTH folder
Cannot upload more than 50 Mb in Sharepoint 2003 library
SQL syntax question -- exclude NULL record
PhysicalDrive0 in VBNET
VBS, SQL, Access, ODBC - Problems with an Insert Statement