473,395 Members | 2,192 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,395 software developers and data experts.

Need to re-write and INTERSECT Query that will work in an older version of Access or

This is the query using 1 table.

select hrtemno, hrtdpcd, hrttodt, hrtgpno from hraact where hrttrtp IN ('p','l')
intersect select hrtemno, hrtdpcd, hrttodt, hrtgpno from hraact where hrttrtp = 'm'
Sep 27 '10 #1
2 989
MMcCarthy
14,534 Expert Mod 8TB
Hi Harry, Welcome to Bytes.

Unfortunately Access doesn't support Intersect queries. A work around would be to use a combination of the inner join and a sub query as follows.

Expand|Select|Wrap|Line Numbers
  1. SELECT hrtemno, hrtdpcd, hrttodt, hrtgpno 
  2. FROM hraact AS h1 INNER JOIN (SELECT hrtemno, hrtdpcd, hrttodt, hrtgpno FROM hraact WHERE hrttrtp = 'm') AS h2
  3. ON h1.hrtemno=h2.hrtemno
  4. where h1.hrttrtp IN ('p','l')
I made an assumption that hrtemno was your primary key.
Sep 27 '10 #2
Thanks, I was trying to write something like that, but was not even close!
Sep 28 '10 #3

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

Similar topics

1
by: OramaF1Net | last post by:
I Need Update one table of a company This system is all in Excel with table of clients and prices of products. I like to develop a site with database in a language php-sql, however i need a...
0
by: Dave Navarro | last post by:
I am a PhP newbie and I need to add "very simple" weather information to a site. Just the weather icon, temperature and description: http://www.beach989.com/main.php has a static sample of...
8
by: Michael McGarry | last post by:
Hi, I am horrible with Regular Expressions, can anyone recommend a book on it? Also I am trying to parse the following string to extract the number after load average. ".... load average:...
4
by: ajikoe | last post by:
Hello, For example I have a string : "Halo by by by" Then I want to take and know the possition of every "by" how can I do it in python? I tried to use: p = re.compile(r"by") m =...
17
by: Jochen Luebbers | last post by:
Hi, I've a problem: I compile modules of embedded SQL (for a dynamic lib) on multiple platforms (AIX,Linux,Windows). They are compiled from the same source code. To be able to provide all...
15
by: RichGK | last post by:
I have an abstract class that provides the basis for SQL data access functions, with the subclasses building on this to create access to tables via select query strings. I have created the...
11
by: Chris Thomasson | last post by:
Consider an an object that that can has 7 or 8 functions. If you create an abstract base class for the "interface" of the object, well, that means 7 or 8 pure virtual functions right? Well, IMHO,...
12
by: Robbo | last post by:
Hi, My database contains 45 tables the structure of which is evolving as I develop. I need a utility that will "read" the structure of this database and it's tables and then create an identical...
13
by: Anton Slesarev | last post by:
I've read great paper about generators: http://www.dabeaz.com/generators/index.html Author say that it's easy to write analog of common linux tools such as awk,grep etc. He say that performance...
5
by: Pat | last post by:
While I can use a for loop looking for a match on a list, I was wondering if there was a one-liner way. In particular, one of my RE's looks like this '^somestring$' so I can't just do this:...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.