timberadmin
asked on
SQL variable restriction
I'm creating a stored proc with a variable @AsOfDate as date. Now, I only want to accept the input date if it is within 3 days of today, otherwise it should not accept it and throw an error. Currently I'm doing this with a IF/ELSE statement. Is there a better way of handling this?
I'm using SQL 2012
I'm using SQL 2012
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I'm sure there are other ways, but this is the way I'd do it.
btw Did you really want to throw an error, which would involve RAISEERROR, or just handle it?
btw Did you really want to throw an error, which would involve RAISEERROR, or just handle it?
ASKER
If this stored proc is run from Excel VBA, I want the user to see the error message I give.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER