This topic is locked

Filtering By Date

3/22/2010 11:49:30 AM
ASPRunnerPro General questions
C
cordaco author

I am trying to filter coupons by expiration date. In other words, once the expiration date is reached I need that entry to not display.
I have tried all of the following:

<= Date

<= Now

<= "Date"
Please help...

Sergey Kornilov admin 3/23/2010
select ...

from ...

where datefield <= now()


If this doesn't work let us know what database do you use and what exactly doesn't work.

C
clig 3/26/2010



I am trying to filter coupons by expiration date. In other words, once the expiration date is reached I need that entry to not display.
I have tried all of the following:

<= Date

<= Now

<= "Date"
Please help...


In T-SQL - didn't test it with NOW() - but this will display records with datefield that equals or greater than today

datefield >= DATEADD(d, - 1, GETDATE())

ficcionista 4/7/2010

You could try something like this:

select something from table where datefield = curdate();