473,386 Members | 1,973 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Designing a query to find matching records in 2 other queries.

I want to design a query that checks 2 other queries for overlapping planning times. I generate recurring events in a query. It generates dates and beginning times and ending times. There is also an itemID int the records. I want to chech if that item beginning time clashes with time slots in the other records in the same query. I was thinking of putting the querie twice in one other. But how do i compare all the records to each other ?

One of those queries can be as big as 50.000 records.

I think it will not be that difficult but i do not "see" it.
Sep 17 '10 #1

✓ answered by ChipR

You can design a query using the same input table/query twice. The query designer will automatically add AS TABLE_1 to differentiate them. Then you can query for MyTable.StartTime BETWEEN MyTable_1.StartTime AND MyTable_1.EndTime. Or something similar.

I'm concerned, though, about how you determine whether these events are on the same day of the week or month if they are recurring.

8 2119
ChipR
1,287 Expert 1GB
So for each record in one query, you want to check whether its beginning time is between the beginning and ending times of each record in the other query?
Sep 17 '10 #2
Hi ChipR,

That is correct. And on top of that, the two queries are indentical. In fact it is one query and i want to check in that query if a "start time" falls between "All the start times" and "All the and times" .

It is a query with recurring events and i want to check if an employees planning time is clashing. He can not be in two places at the same time :-)
Sep 17 '10 #3
ChipR
1,287 Expert 1GB
You can design a query using the same input table/query twice. The query designer will automatically add AS TABLE_1 to differentiate them. Then you can query for MyTable.StartTime BETWEEN MyTable_1.StartTime AND MyTable_1.EndTime. Or something similar.

I'm concerned, though, about how you determine whether these events are on the same day of the week or month if they are recurring.
Sep 17 '10 #4
In the query there are real dates generated, so one of the criteria is that the dates must then also be the same.
Sep 17 '10 #5
ChipR
1,287 Expert 1GB
In that case, I would join the tables on the date field, and only show records where they were equal and the times conflicted.
Sep 17 '10 #6
I do not have the time to test this right now. I looks good but in the first test return too much records. I will test it very soon and get back to you. Thanks for the help so far.
Sep 17 '10 #7
It is a little rough and i am still testing but the results are there. I could not use the "Between" statement in the query but "Is smaller than" and "Is larger than". but you absolutely pointed me in the right direction.
Thank you very much!
Sep 18 '10 #8
okay i am doing some thing similer to this but i want the records that are not in the other query. every thing i try just gets me the results for whats in both.
Sep 24 '10 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: rowan[canspam] | last post by:
I have two tables ITEMS: items,description,mfg MANUFACTURER: mfg,full_name The items database has 230,000 records, the manufacturer, 493 records. I want to see how many records in the...
2
by: Joe Del Medico | last post by:
I have two tables A & B and I want to delete all the records in A that are not in B. Can I do this in the query builder? It seems like a simple problem. I can easily find the records in A that...
1
by: Brian | last post by:
I'm trying to find a way to search multiple tables for the same record. Say I have 3 tables all with a name column, I need to search all 3 tables and find matching names. Is there an easy way to...
3
by: Ken Mylar | last post by:
I have a problem that just showed up and I'm not sure why. I have a query that is supposed to show all records that have an Inspection Due Date any time in the past up until the end of the...
3
by: fong.yang | last post by:
I have tried to use the query wizard to find unmatched records but it doesn't seem to be going right. The results are still giving me some records that are in both tables. I have two tables...
2
by: Zeljko | last post by:
I'm creating Address book. Header of the main form (frmAddress) contains combo box (cboFilter) to filter records by Occupation on main Form(Ocupation1). That's working. Combo box also have "Show...
1
by: neha02 | last post by:
Hi all, this is my first post here although i've always referred this forum for help. I am trying to design a query based on 4 queries but i'm unable to get the result i want. Please help me-...
5
by: jennwilson | last post by:
Using Access 2000 - I have a query that is suppose to return the records from table within specified time range and find matching data from another table . Table houses Clinician name, location...
11
by: jennifersalcido | last post by:
Hello All, I am working with two tables that contain inventory data: 1) INVENTORY contains item_number, description, etc. This data is relatively straight-forward, one record per item_number....
9
by: warrior2009 | last post by:
I have 2 lists (unlinked and unrelated), where one can be called the parent and the other the child with one to many relationship between parent-child. The child table is really big, over a million...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.