nick210577
asked on
What's wrong with the following statement. It keeps returning Null?
I've never used an SQL if statement before. @DaysUsed does in certain circumstances = Null but I need it to be zero for later calculations. @DaysUsed is a int. I don't understand why if the statement is true it doesn't set the variable to 0?
If @DaysUsed = NULL
Begin
Select @DaysUsed = 0
End
Select @DaysUsed
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks.... IS not = How annoying... thanks
Select @DaysUsed = ISNULL(@DaysUsed , 0 )