[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Search query for Month MS Access

Posted on 2009-02-13
3
Medium Priority
?
254 Views
Last Modified: 2012-05-06
Hi Experts,

I am using MS Visual Studio .Net 2005 - I am using a MS Access as my back end. I have used this method of inserting date into the field:
http://forums.asp.net/t/1079456.aspx

Now that the dates are inserted, I am looking to create and run a query to search ONLY the month. I.E To search for records in august ONLY - I would like it to display an out put of all records in that month. I am aware of the fact that it will also display 2006, 2007 etc.. records but will like to sort it newest entry order.

Any help relating in compiling this query within MS Visual Studio 2005 .Net c# using MS Access as my database will be appreciated.

Regards,

introlux
0
Comment
Question by:introlux
3 Comments
 
LVL 2

Accepted Solution

by:
patrickriva earned 1400 total points
ID: 23631465

In Access it should be something like

SELECT .....
FROM ....
WHERE Month([date_filed_name]) = 8
0
 
LVL 74

Assisted Solution

by:Jeffrey Coachman
Jeffrey Coachman earned 600 total points
ID: 23644406
introlux,

...If you want a parameter prompt to pop-up so you can type in month value, you can modify the above code slightly:

SELECT .....
FROM ....
WHERE Month([date_filed_name]) = [Enter a Month Number]

(Of course you can build an interface in Access with a drop down displaying months from which to choose from, but that is another issue.)


JeffCoachman
0
 

Author Closing Comment

by:introlux
ID: 31546510
This works! Thanks for the reply!
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question