Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / New Users / April 2006

Tip: Looking for answers? Try searching our database.

Queries

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
cardfan057 - 11 Apr 2006 03:40 GMT
I am trying to produce a query that will show sales dates between 9 months
and a year ago, what would be the best way to show those results.

Signature

cardfan057

fredg - 11 Apr 2006 06:29 GMT
> I am trying to produce a query that will show sales dates between 9 months
> and a year ago, what would be the best way to show those results.

As criteria on the SalesDate field:
Between DateAdd("m",-9,Date()) and DateAdd("m",-12,Date())
Signature

Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

cardfan057 - 11 Apr 2006 11:17 GMT
So the formula will be something like Between DateAdd("m",-9,Date(04/01/06))
and DateAdd("m",-12,Date(04/01/06))??

Signature

cardfan057

> > I am trying to produce a query that will show sales dates between 9 months
> > and a year ago, what would be the best way to show those results.
>
> As criteria on the SalesDate field:
> Between DateAdd("m",-9,Date()) and DateAdd("m",-12,Date())
fredg - 11 Apr 2006 17:56 GMT
So the formula will be something like Between DateAdd("m",-9,Date(04/01/06))
and DateAdd("m",-12,Date(04/01/06))??

cardfan057

"fredg" wrote:

> On Mon, 10 Apr 2006 19:40:02 -0700, cardfan057 wrote:
>
[quoted text clipped - 3 lines]
> As criteria on the SalesDate field:
> Between DateAdd("m",-9,Date()) and DateAdd("m",-12,Date())

No, the 'formula' is exactly what I wrote.
Date() is a built-in Access function which returns the current date.
You do not write it in as you have above.
To verify this, press Ctrl + G
When the debug window opens, write
? Date()
It will print the current date.

I would suggest, while the debug window is still open, that you then click
on Help, and type Date in the Index box.
Find all of the Date and Time functions available and read up on their usage.
Signature

Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.