Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Credit Limit Not Null and In Range
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Credit Limit Not Null and In Range
Miscellaneous
Thread ID:
01375287
Message ID:
01375287
Views:
56
I want to pull records in a proc.

If both @CreditLimitMin and @CreditLimitMax were passed, then it should pull records with limits in between both
If @CreditLimitMin was passed and @CreditLimitMax was not, then it should pull records a limit equal to or above it
If @CreditLimitMax was passed and @CreditLimitMin was not, then it should pull records a limit equal to or below it


Here's what I have so far
SELECT * 
	FROM Customers
	WHERE RecordId = ISNULL(@RecordId, RecordId) AND
		  FirstName = ISNULL(@FirstName, FirstName) AND
		  LastName = ISNULL(@LastName, LastName) AND
		  BETWEEN @CreditLimitMin AND @CreditLimitMax AND
		  State = ISNULL(@State, State) AND
		  Active = ISNULL(@Active, Active)
What am I doing wrng here?
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Next
Reply
Map
View

Click here to load this message in the networking platform