tags:

views:

26

answers:

2

I need to get all rows tha are valid, ValidDate is column that shows how long these database items are valid. I need to get only valid items from the database. How can I do that? I use SQL Server.

+2  A: 

Assuming ValidDate means valid until:

SELECT Cols
FROM MyTable
WHERE getdate() <= ValidDate 
Mitch Wheat
This worked thanx!
newbie
+2  A: 

Something like this perhaps?

SELECT * FROM table WHERE ValidDate => GETDATE()
Tommi
not quite valid TSQL...neds to be getdate() <= ValidDate
Mitch Wheat
Ok, my bad, didn't have access to SQL Server db at the time of writing my answer...
Tommi