Wrox Programmer Forums
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old October 18th, 2007, 05:45 AM
Registered User
Join Date: Oct 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Dates in Access

The table I want to run the query on has a date in the format of dd/mm/yyyy. I want to be able to run a query so that the user can type in a month and all records with dates in that month will be shown.

I have done this before many years ago but now have a mental block and cant figure it out.

Any help with this would be greatly appreciated

Old October 18th, 2007, 06:41 AM
Friend of Wrox
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts

How will the user type in the month? I think you should give them a combo with two columns. Column(0) = 1 - 12, and Column(1) = "January" - "December"

Allow them to select a month, and then add a column in the report called "SelMonth" (for selected month) that is:

SelMonth:(DatePart("m", [DateColumnName]))

Then in the criteria line add this:

Criteria: [Forms]![frmYourFormName].[cboDateSelectComboName]

When the query opens, it will select the records with a Month with the selected numeric value. You don't have to display the SelMonth column in your results.

That is one way of doing it. With information on buttons to launch the query, or reports or forms to display the query results, I could post other methods.

In this case, Date format won't matter unless this is not a Date column, but a text column. If it is a text column, then you have other issues.

Did that help?


Similar Threads
Thread Thread Starter Forum Replies Last Post
help adding dates to ms Access db MarkGT Classic ASP Basics 11 April 22nd, 2008 11:34 PM
access calendars multiple dates RobertCoats Access 0 June 23rd, 2005 02:14 PM
Problem with Dates in Access Varg_88 Classic ASP Databases 2 December 8th, 2004 09:42 PM
SQL Problem in access with dates tucker SQL Language 4 December 19th, 2003 12:16 PM
Dates oathamm Servlets 1 June 27th, 2003 05:43 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.