Click here to Skip to main content
15,887,434 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi, i m saving data into database and have column name[deadline] that stores data in datetime format. I need to delete/(make display off) the data from the table when [deadline]>current date....how should i do this...i m not finding any claue how this should be done...
Posted

1 solution

To display you just need a select statement:
SQL
SELECT * FROM myTable WHERE deadline>GETDATE()

For delete, it's much the same:
SQL
DELETE FROM MyTable WHERE deadLine>GETDATE()
 
Share this answer
 
Comments
symonsarwar 29-Jul-12 15:22pm    
where should i use this query? how it should happen?
OriginalGriff 30-Jul-12 3:25am    
That depends on how you are doing things.
Without any idea of how your code works, I can't say!
symonsarwar 29-Jul-12 15:59pm    
i want to make the display off

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