Forums

This topic is locked

Filter recordset by Date -14

Posted 14 Mar 2004 15:05:42
1
has voted
14 Mar 2004 15:05:42 phil C posted:
Hi All

i have an access driven site that i need to filter the record set on the results page by only displaying records that are older than 14day.

i have already got all the other search critea working fine but now need to restrict the results thus withholding anything entered in the last 14 days (as this info is for premium accounts only)


currently each record in the database has a date field in the format dd/mm/yyyy

i've had a search within forum but am just getting more confused..

Can you help..

Replies

Replied 15 Mar 2004 21:15:22
15 Mar 2004 21:15:22 Dave Clarke replied:
heres what I use (obvioulsy substitute your table and field names)

SELECT *
FROM tablename
WHERE ((tablename.fielddate<=Date()-14))


Dave

ASP|VBScript|IIS5.1|Access|WinXPPro & WinXPHome

Edited by - Davecl on 15 Mar 2004 21:16:04
Replied 16 Mar 2004 14:02:20
16 Mar 2004 14:02:20 phil C replied:
Thanks Dave

That does the trick.
It seems so simple when you know how.


Phil
Replied 15 May 2007 12:28:46
15 May 2007 12:28:46 irfan sam replied:
Dear Sir
i am hving same situation but the thing is i am using mysql and php
so what code i should apply
waiting for ur reply
thanks in advance

Reply to this topic