March 20, 2006 at 2:14 pm
look up isnull function in bol.
March 21, 2006 at 4:22 am
And/Or set a default.
ALTER TABLE tablename
ADD CONSTRAINT columnname_default
DEFAULT 0 FOR columnname
March 24, 2006 at 5:09 pm
If NULL is a legitimate value ie. (NO VALUE), 0, 1, 2 you can use the COALESCE function to get the result your looking for. ie. the following example return's eight when Field1 is null
SELECT
[Name],
COALESCE( [Field1], 8 )
FROM
TABLE
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply