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 / Queries / December 2005

Tip: Looking for answers? Try searching our database.

Date queries

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kirk P. - 02 Dec 2005 13:07 GMT
I'm querying a table with subscription information that contains customerID
and end date.  I want to query for all subscriptions ending in December, so
I'm entering criteria of "between 12/1/2005 and 12/31/2005.  That works fine,
but can I enter the criteria to query for all dates within a month, for
example Dec-2005?

It would just save a little keying.
John Spencer - 02 Dec 2005 15:34 GMT
Yes, you can, but the retrieval will be slover - with small databases the
speed difference may not be apparent.

One method, add a new column to your query

Field: MonthYear: Format([EndDate],"mmm-yyyy")
Criteria: ="Dec-2005"

Another method would be to use criteria like the following
Field:[End Date]
Criteria: Between DateSerial([What Year?],[What Month number?],1) And
DateSerial([What Year?],[What Month number?]+1,0)

This would pop up two dialogs when you run the query - asking you for the
year number and month number.  You would enter 5 and 12 for December 2005.

Another method would be to use a form to get the date parameters and have
the query grab them from the form.

> I'm querying a table with subscription information that contains
> customerID
[quoted text clipped - 6 lines]
>
> It would just save a little keying.
 
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.