Click here to Skip to main content
15,886,625 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hai all,

How to get expired data(s) with a date column in SQL.

I am try this query

Select * from MyTable where Date <= getdate()


please help me..
Posted

1 solution

This will get all the records where the date is passed by a minute granularity (you can use d instead of m for days):

SQL
select * from MyTable where DateDiff(m,date,getdate()) > 0
 
Share this answer
 
Comments
version_2.0 20-Sep-11 8:30am    
thanks..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900