944,214 Members | Top Members by Rank

Ad:
Aug 29th, 2007
0

query a date format within an input box

Expand Post »
Hi folks

This will be my first ask for help here

I'm working on a database at the moment and have exhausted my resources on this one.

I have a report with an underlying muti-table query. The report uses an input box to set the date criteria rather than Parameter boxes to show the relevant records from to these dates.

and then I've used
 Between [Forms]![frmMonthlyDisbursalDialog]![StartDate] And [Forms]![frmMonthlyDisbursalDialog]![EndDate]
within the query to reference to the dates seleted within the input box All is working well here.

My question is. If I wanted to use just the Month and Year as criteria, so that I would, perhaps, just have a drop down month combo box and a control for the year. Is it possible to extract the records for that month rather than typing in the exact date to that day?. Or maybe something similar to this technique?

All my other attemps have failed. Hope someone can help.
Last edited by pablavo; Aug 29th, 2007 at 10:37 am.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
pablavo is offline Offline
6 posts
since Aug 2007
Aug 29th, 2007
0

Re: query a date format within an input box

Hi,

The easiest way is using the function DateSerial so that it would look like Between DateSerial([Forms]![frmCriteria]![txtFrmYr],[Forms]![frmCriteria]![comFrmMth],1) And DateSerial([Forms]![frmCriteria]![txtToYr],[Forms]![frmCriteria]![comToMth],1). I have included an example that demonstrates this case, hope it is what you are looking for.
Attached Files
File Type: zip Sample.zip (20.9 KB, 128 views)
Reputation Points: 13
Solved Threads: 29
Junior Poster
kb.net is offline Offline
169 posts
since Aug 2007
Aug 30th, 2007
0

Re: query a date format within an input box

Kb.Net wrote
The easiest way is using the function DateSerial so that it would look like

That's brilliant Kb.net! thankyou! I just have one more question. If I use use the input box and put Dec 2006 to Jan 2007 will that just give me the month of December without pulling records from January?

Thanks again.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
pablavo is offline Offline
6 posts
since Aug 2007
Aug 30th, 2007
0

Re: query a date format within an input box

Ah, Ok it gives me the first day of the "To Month" and then I place a minus 1 " -1)" like so, and that takes away the first day of the "To Month.

Between DateSerial([Forms]![frmCriteria]![txtFrmYr],[Forms]![frmCriteria]![comFrmMth],1) And DateSerial([Forms]![frmCriteria]![txtToYr],[Forms]![frmCriteria]![comToMth],1-1)

Great!
Reputation Points: 10
Solved Threads: 0
Newbie Poster
pablavo is offline Offline
6 posts
since Aug 2007
Jan 29th, 2008
0

Re: query a date format within an input box

Hello. I'm working on a similar project. Is it possible to have the results returned in another form, Rather than a report? I want to do a Date range search and then be able to edit the data in my resulting records. Thanks
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Milster is offline Offline
1 posts
since Jan 2008
Feb 5th, 2008
0

Re: query a date format within an input box

Click to Expand / Collapse  Quote originally posted by Milster ...
Hello. I'm working on a similar project. Is it possible to have the results returned in another form, Rather than a report? I want to do a Date range search and then be able to edit the data in my resulting records. Thanks
Yes, you would do similar to what was shown for the report but base the criteria of the recordsource of the other form as shown above.
Reputation Points: 31
Solved Threads: 8
Junior Poster in Training
boblarson is offline Offline
77 posts
since Jan 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in MS Access and FileMaker Pro Forum Timeline: Using a form to automate Reports in Access 03
Next Thread in MS Access and FileMaker Pro Forum Timeline: How do I make my Access database work with MS SQL Server?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC