Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

More issues with Dates

Status
Not open for further replies.

corrado

Technical User
Jan 29, 2002
13
US
I had sent out a message a few days ago and had responses, however this is still not bringing back correct data:
I'm only concerned with the where clause. The [ACCOUNT Query].MAJCOM works fine.

Issue: want to display only dates that are older than 1 year from todays date. (for Account.Letter Data)

Data: Account.Letter

10 Oct 2000
19 Sept 1999
2 Jan 2002
1 Feb 2002

Formula: WHERE ((([ACCOUNT Query].MAJCOM)=&quot;PRIMARY&quot;) AND ((ACCOUNT.LETTER)<DateAdd(&quot;yyyy&quot;,-1,Date())));

Should display Only:

19 Sept 1999

Problem: Brings back ALL data.

Any Idea's ?

Thanks
 
It should also bring back

10 OCT 2000
 
Is ACCOUNT.LETTER a date field? Looks like text.

Try: WHERE ((([ACCOUNT Query].MAJCOM)=&quot;PRIMARY&quot;) AND
(CDate(ACCOUNT.LETTER)<DateAdd(&quot;yyyy&quot;,-1,Date())));
 
Yes it is set as a text field. I set it to short date (date/time)and brought back correct information.

Thank you

DJ
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top