I have a SQL Server table containing a TEXT column and a DATETIME column .
I’m trying to write a stored procedure which will return the TEXT column and a BIT (0 or 1) depending on whether the date/time is less than the current timestamp.
Does anyone know the correct syntax? I’ve tried the following, but no luck.
SELECT ticket, (ticketExpires < getDate())
FROM Authentication
WHERE accountID = @id
Any suggestions appreciated!
Thanks.
Yes, using the
CASEexpression:You’d change the return value based on whether you’re looking for a value that indicates
IsExpiredorIsValid.