Forums
This topic is locked
DW8 MS Access Question
Posted 17 years ago
1
has voted
17 years ago 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 17 years ago
17 years ago 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
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 17 years ago
17 years ago 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.
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.