Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Checking if no records returned
Message
From
21/02/2011 09:41:03
 
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Environment versions
SQL Server:
SQL Server 2008
Miscellaneous
Thread ID:
01501074
Message ID:
01501080
Views:
39
>>I tried changing the logic to this:
>>
>>
	IF @MonthsToAdd = 0 OR @MonthsToAdd = NULL
>>	BEGIN
>>		SET @DatePaidTo = @IssueDate
>>	END
>>	ELSE
>>	BEGIN
>>		SET @DatePaidTo = ISNULL(DATEADD(M, @MonthsToAdd, @IssueDate), @IssueDate)
>>	END
>>
>>
>>and that has got it, but I'm not sure why :(
>
>I was just going to make a better suggestion
>
>set @MonthsToAdd = coalesce(@MonthsToAdd,0) and keep your original code.
>
>Also, you can not write @MonthsToAdd = NULL. The check for NULL should always use IS word, not equal sign.

Thanks
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform