![]() |
|
|
#1
|
|||
|
|||
|
I need to Query two different dates in the same table. One of the fields is called Today and the other is Rev_date. I want to be able to enter just one set of dates for beginning range and end range and have it bring up records that match both of the fields dates. Hope that makes sense. Any idea on how to do it?
|
|
#2
|
|||
|
|||
|
no so clear for me. where are you going to put your beginning range and ending range criteria? I am just wondering how in the world you have two date fields and how you input into them and wanting to bring matched records between them?
anyway, you can make two queries: one for TODAY field only and another query for REV_DATE only. then you can create your third query. the third query recordsource will be the TODAY query and REV_DATE query. just join the TODAY and REV_DATE fields so you will have match records for both fields. with regards to entering one set of date, you can make one form which you can name "form1" which has two fields named: begdate and enddate. also has one commandbutton which you can name "ok" on your query today and query rev_date, set the criteria to BETWEEN forms!form1!begdate and forms!form1!enddate then on On_Click event of your "ok" commandbutton: private sub Ok_click() DoCmd.OpenQuery "nameofthirdquery", acViewNormal, acReadOnly docmd.Close acForm,"form1",acSaveNo END SUB the above code is just a simple coding but it should work for that purpose. let me know what happens! |
|
#3
|
|||
|
|||
|
the Today field is the day it was entered in the DB and the Rev_date is the most recent day the record was updated. So i need the query to pull records with matching today fields within a range as well as the Rev_dates within the same date range. Right now i am just using the between command in the today field and if do the same for the rev_date field i have to enter in the same date twice, which i am trying to avoid.
|
|
#4
|
|||
|
|||
|
you dont need to enter the date twice. check my advice on making a FORM on my first reply. that should do it.
|
|
#5
|
|||
|
|||
|
going to try that when i get to work thanks a lot for the help. I took some access classes while getting my degree but didn't use it and forgot most of it haha. Now getting thrown back into it at work so really appreciate the help.
|
|
#6
|
|||
|
|||
|
Went through and did every in your first post but it isn't returning any dates at all. anything i should post to see about debugging?
Last edited by Eildydar; 04-15-2009 at 02:39 PM. |
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| help creating a sequential number for records in a table or query | rthomas | Access | 1 | 01-31-2009 07:43 AM |
| Delete all records in a table? | bob646 | Access | 1 | 05-20-2007 09:41 PM |
| Inserting multiple records into a table | New2Access | Programming | 0 | 02-18-2007 09:46 PM |
| Creating a string from all records in a table | ocordero | Programming | 2 | 08-07-2006 07:21 AM |
| Selecting and modifying records in a table | Ed H | Access | 1 | 03-17-2006 09:04 AM |