Forums

This topic is locked

DW8 MS Access Question

Posted 19 May 2007 17:27:26
1
has voted
19 May 2007 17:27:26 Jim Thomas posted:
Working on a real estate site where agents post listings. Have a field there called Posted_Date that captures the date the listing is posted. On the output side I want to show only listings with a "Posted_Date" of less than 30 days old using the "Date()" method. On the realtors side I want to display records only more than 30 days old. Can somebody tell me how to accomplish this? Thanks in advance for your help.

Replies

Replied 18 Jun 2007 16:38:14
18 Jun 2007 16:38:14 Seb Adlington replied:
Hi Jim,

You can do it using DATEDIFF

SELECT ID, CName, createddate
FROM customerdetails
WHERE DATEDIFF ('d', createddate ,DATE()-30) <= 30

for the Realtors just make it >=30
or something like all that anyway <img src=../images/dmxzone/forum/icon_smile_wink.gif border=0 align=middle>

Cheers

Seb

Replied 18 Jul 2007 06:49:15
18 Jul 2007 06:49:15 Nada Boo replied:
I would do two queries one for more than 30 days and one for less then link them independently to the web site.

An example of what I have used in the past is: DateSerial(Year(Now()),Month(Now()),1)-1

So basicly you specify a certain time frame around the current date.

Reply to this topic