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 July 17th, 2006, 12:45 PM
Authorized User
 
Join Date: Jul 2006
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default Pull Records based on Dates

Any ideas on how I can pull records from a query within a date range? Each record has a date stamp and I would like to be able to put the start and end dates into text boxes on a form and return the results in the query.

 
Old July 17th, 2006, 01:06 PM
Authorized User
 
Join Date: Jul 2006
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Never Mind I found the answer. I put the search condition within the query instead of the form and it works great thanks.

 
Old July 17th, 2006, 02:41 PM
Friend of Wrox
 
Join Date: Dec 2005
Posts: 142
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You can use VBA to pull the value of the form textboxes into variables (i.e. dteStart, dteEnd) and create a query such as:

"SELECT * " & _
"FROM tbl " & _
"WHERE tbl.TimeStamp >= #" & dteStart & "# AND tbl.TimeStamp <= #" & dteEnd & "# ;"

 
Old July 17th, 2006, 03:42 PM
Authorized User
 
Join Date: Jul 2006
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ah sweet! thanks for the reply it is nice to find other ways to do things. You never know when you will need it. I will play around with this method as well and see which one works out better for me. THANKS !!






Similar Threads
Thread Thread Starter Forum Replies Last Post
problem to get dates based on year and weeknumber vsempoux Java Basics 1 August 11th, 2008 01:51 AM
Pull records from the database one batch at a time pallone .NET Framework 2.0 0 November 26th, 2007 07:00 PM
Get records between 2 dates and times jlecates Access 1 February 21st, 2007 03:30 PM
View records based on formula deepakbhota Crystal Reports 0 August 11th, 2005 08:35 AM
form, archive records between dates bubblez Access 2 October 2nd, 2003 08:34 PM





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