Lookup credit card expiry

I have a table with an int for the expiry month and an int for the expiry month, so 1 - 12 for the month and 2017 , 2018, 2019 etc for the year.

I need a query to lookup if a card will expire next month.
LapchienDirectorAsked:
Who is Participating?
 
Mark WillsTopic AdvisorCommented:
How about something like :

Select *
from YourTable
where Month_Column= datepart(month,dateadd(month,1,getdate()))
and Year_Column = datepart(year,dateadd(month,1,getdate()))

Open in new window

0
 
LapchienDirectorAuthor Commented:
Straightforward, thank you so much
0
 
Mark WillsTopic AdvisorCommented:
A pleasure :)  

Very pleased to hear you think it is straight forward - I was kicking myself for not explaining :)

Cheers,
Mark
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.