User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MS Access and FileMaker Pro section within the Web Development category of DaniWeb, a massive community of 426,930 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,460 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MS Access and FileMaker Pro advertiser: Programming Forums
Views: 5578 | Replies: 5
Reply
Join Date: Aug 2007
Posts: 6
Reputation: pablavo is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
pablavo pablavo is offline Offline
Newbie Poster

Question query a date format within an input box

  #1  
Aug 29th, 2007
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 9:37 am.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Aug 2007
Location: KSA
Posts: 147
Reputation: kb.net is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 26
kb.net's Avatar
kb.net kb.net is offline Offline
Junior Poster

Re: query a date format within an input box

  #2  
Aug 29th, 2007
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, 26 views)
It is never about the number of languages you know, you either have the logic of programming or you don't ...

Some of the codes I post are collected from different sites during the past couple of years, so I would like to thank them for their help and for enabling me to help.
Reply With Quote  
Join Date: Aug 2007
Posts: 6
Reputation: pablavo is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
pablavo pablavo is offline Offline
Newbie Poster

Question Re: query a date format within an input box

  #3  
Aug 30th, 2007
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.
Reply With Quote  
Join Date: Aug 2007
Posts: 6
Reputation: pablavo is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
pablavo pablavo is offline Offline
Newbie Poster

Re: query a date format within an input box

  #4  
Aug 30th, 2007
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!
Reply With Quote  
Join Date: Jan 2008
Posts: 1
Reputation: Milster is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Milster Milster is offline Offline
Newbie Poster

Re: query a date format within an input box

  #5  
Jan 29th, 2008
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
Reply With Quote  
Join Date: Jan 2008
Posts: 29
Reputation: boblarson is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 2
boblarson's Avatar
boblarson boblarson is offline Offline
Light Poster

Re: query a date format within an input box

  #6  
Feb 5th, 2008
Originally Posted by Milster View Post
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.
Bob Larson
____________________________________
Access MVP
For Quick Tutorials and Samples for Microsoft Access: BTAB Development
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb MS Access and FileMaker Pro Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the MS Access and FileMaker Pro Forum

All times are GMT -4. The time now is 12:05 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC