date calculation

ashley1

Registered User.
Local time
Today, 12:46
Joined
Apr 7, 2005
Messages
35
Hi Every1

I need sum quick help
I want to pick out the date from my table that is 2 weeks old?
Any ideas how to do this?

thanks
 
i have tried but its not giving me any results
this is what i use

DateAdd("d",-14,[PostDate])
 
I have helped. Now help me! Where did you try the DateAdd() function? Did you get an error? Do you have any records with a date that's exactly 14 days old?
 
i got no results at all
no errors
i put the DateAdd("d",-14,[PostDate]) in the PostDate Field in a query so my query looks like this

Code:
SELECT Main.[Student code], Main.[Address Line 1], Main.[Address Line 2], Main.[Address Line 3], Main.[Address Line 4], Main.[Address Line 5], Main.Country, Main.Postcode, Main.[E-mail address], Main.Title, Main.[Forename 1], Main.[Forename 2], Main.[Forename 3], Main.Surname, Main.Gender, Main.PostDate, Main.WithdrawnDate
FROM Main
WHERE (((Main.PostDate)=DateAdd("d",-14,[PostDate])) AND ((Main.WithdrawnDate) Is Null));
 
And do you have records that are exactly 14 days before [PostDate] or are you wanting records that are greater than or equal to 14 days?
 
i want all records that are 14+ days old
So i have field "PostDate" if the date is 14 or more days old then pull out that record!!!!
 
Then you need to state that it's over fourteen days. As it is you have it set to exactly fourteen days.

Just change the operator.

Code:
 (((Main.PostDate) >= DateAdd("d",-14,[PostDate]))
 
hmmm not what i quite want
its pulling out all dates
bascially what i want the query to do is pull out records where the date is 14 days old so if it has date 25/05/2005 then dont bother with that record
but any dates 17/05/2005 and 16/05/2005 then pull out
 
Sorry, got the wrong operator:

Code:
(((Main.PostDate) <= DateAdd("d",-14,[PostDate]))
 
that didnt really work it bought out no records
i think this mite have

((Main.PostDate)<=Date()-14)
 

Users who are viewing this thread

Back
Top Bottom