I have a table which stores expiry dates of credit cards
ExpiryDate Varchar(10) --datatype
The dates look like this:
'08/10'
'09/11'
'08/16'
'10/17'
how can i find out if a card's date is expired?ANS:
SELECT * from Table where isactive=1
AND LEFT(ExpiryDate
, 2) >= MONTH(GETDATE())
AND RIGHT(ExpiryDate
, 2) >= RIGHT(YEAR(GETDATE()), 2)
No comments:
Post a Comment