Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Checking if no records returned
Message
De
21/02/2011 09:41:03
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Stored procedures, Triggers, UDFs
Versions des environnements
SQL Server:
SQL Server 2008
Divers
Thread ID:
01501074
Message ID:
01501080
Vues:
40
>>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform