473,785 Members | 2,844 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with join on same table in two different dbs

I have two databases, db1 and db2, with the same table, TableA. I want to
select the records from TableA in db1 that have a LAST_UPDATE SomeDate.
Then I want to get the identical records in TableA from db2. However the
LAST_UPDATE dates will be different between db1 and db2. That's the point. If
they are different, then there were changes made to the record in db1. I'm
going to then process this further to find out what the changes were.

But right now I just want to construct an SQL statement that I can use in
code to return the data that I need. Ultimately, I'm going to run this code
on over 100 tables. That's why I need to apply some type of filter (i.e.
LAST_UPDATE SomeDate) in order to have this overall process completed in a
short time.

I guess the statement could just get all records where the LAST_UPDATE is
different between TableA in db1 and TableA in db2. But speed is important,
because ultimately I will apply it to the 100 tables.

Note that db1 is the current database and db2 is an external database.

So, for example, I would have thought the following would work:

------------------------------------------------------------------------------
--

SELECT A.*, B.* FROM [TableA] As A
LEFT JOIN (SELECT * FROM [C:\.....].[TableA]) AS B ON (A.FIELD1 = B.FIELD1)
AND (A.FIELD2= B.FIELD2) AND (A.FIELD3= B.FIELD3)
WHERE A.LAST_UPDATE #SomeDate#

------------------------------------------------------------------------------
--
What's happening right now is that all records from the table are being
returned. In the test case I should have had 1 record returned and instead I
got all of them (1500+)

Thanks.

--
Message posted via AccessMonster.c om
http://www.accessmonster.com/Uwe/For...ccess/200612/1

Dec 26 '06
40 2544
"David W. Fenton" <XX*******@dfen ton.com.invalid wrote in
news:Xn******** *************** ***********@127 .0.0.1:

2. AccessMonster sells ads and makes money off of republishing
content that was posted on Usenet, a public forum where no one
profits from the posts.
"off of"?

Ewwwwwwww!

--
Lyle Fairfield
Dec 28 '06 #31
"David W. Fenton" wrote
And Larry did a very poor job of wording it, as
it was not until a few posts back that I realized
he was criticizing *only* AccessMonster and
not the present poster.
Actually, David, if you'll re-read a few more times, you'll see that I was
not criticizing Access Monster, but only trying to explain why I think Lyle
and others are so un-fond of it.

As you said elsewhere in this thread about your posts, I post material in
hopes that it will be useful to someone. If Access Monster, Google Groups,
and others re-post the material and do not charge people to access it, they
are expediting what I try to do.

And, there's no practical way of preventing people from using our posts in
CD collections of material they gather online and sell. I've had very polite
replies agreeing to remove my posts from such collections, but as I was
never willing to send $$$ for a copy of the CD, I'll never know if they did
or not. And, once I realized it was fruitless, I stopped spending time and
effort complaining about the practice.

Larry Linson

Dec 28 '06 #32
Hi, David.
Yes, but they actually provide a very useful service, quite unlike
AccessMonster.
I just checked AccessMonster's search engine. It goes back 3.5 years, so
they've made an effort to improve their Web site, but searches are still very
limited in scope and flexibility. Google Groups' search capability is much,
much better. However, Google Groups has been cleaning out its archives. A lot
of messages and threads are gone. About 40% of my posts aren't listed in
advanced searches, so I suppose anyone who's been posting for several years or
more probably has a similar amount missing.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
http://www.Access.QBuilt.com/html/ex...ributors2.html for contact info.
"David W. Fenton" <XX*******@dfen ton.com.invalid wrote in message
news:Xn******** *************** **********@127. 0.0.1...
"'69 Camaro" <Fo************ **************@ Spameater.orgZE RO_SPAM>
wrote in news:vK******** *************** *******@adelphi a.com:
>>I've switched over and am now poting in the Usenet group.

From Google Groups? Don't they show ads and "sponsored links"
with posts, too?
<g, d, & r>

Yes, but they actually provide a very useful service, quite unlike
AccessMonster.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/

Dec 28 '06 #33
Hi, David.
>>Frankly, I'm glad he has plonked me.

You may not like his demeanor at times, but Lyle is very, very
generous with his considerable knowledge and expertise. This is
not an event to celebrate.

I find Lyle's advice to be highly idiosyncratic and often not
helpful. I plonked him a long time ago because of that.
I've found I've learned much from the denizens of the Access newsgroups. We
have some very talented and generous experts who post here. You, Larry, and
Lyle are three of them. I wouldn't want rdemyan or anyone else who wants to
learn more about Access and databases to miss out on a treasure trove of
knowledge over a disagreement in a discussion.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
http://www.Access.QBuilt.com/html/ex...ributors2.html for contact info.
"David W. Fenton" <XX*******@dfen ton.com.invalid wrote in message
news:Xn******** *************** ***********@127 .0.0.1...
"'69 Camaro" <Fo************ **************@ Spameater.orgZE RO_SPAM>
wrote in news:UL******** *************** *******@adelphi a.com:
>>I've mentioned several times that I'm a
consultant in this forum and by profit I naturally thought he
meant.....

And that's why Larry tried so hard to explain it's
AccessMonster. com that Lyle takes umbrage with, not that you're
profiting from the code he provides freely.

And Larry did a very poor job of wording it, as it was not until a
few posts back that I realized he was criticizing *only*
AccessMonster and not the present poster.

[]
>>Frankly, I'm glad he has plonked me.

You may not like his demeanor at times, but Lyle is very, very
generous with his considerable knowledge and expertise. This is
not an event to celebrate.

I find Lyle's advice to be highly idiosyncratic and often not
helpful. I plonked him a long time ago because of that.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/

Dec 28 '06 #34
"'69 Camaro" <Fo************ **************@ Spameater.orgZE RO_SPAM>
wrote in news:Zt******** *************** *******@adelphi a.com:
However, Google Groups has been cleaning out its archives. A lot
of messages and threads are gone. About 40% of my posts aren't
listed in advanced searches, so I suppose anyone who's been
posting for several years or more probably has a similar amount
missing.
I can find none of my posts missing going back to 1994. Are you sure
you're looking under the right email addresses?

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Dec 28 '06 #35
Hi, David.
Are you sure
you're looking under the right email addresses?
Yes. I've posted under three E-mail addresses, but whether I add those up or
check the count by author as "69 Camaro," the number is a few thousand shy of
the sum of the number of posts in my Outlook Express Sent box, the number posted
through Google Groups, and the number posted through Microsoft Online
Communities. I have proof of nearly 5,500 posts, all as '69 Camaro. There's a
few hundred more, but I'd have to go through old backups for proof.

This lists 3,440 posts (but at least 7 aren't mine):

http://groups.google.com/groups?as_q...=2006&safe=off

The profile (E-mail address) for the most recent post shows only 3,565 posts.
The other two address profiles show 100 posts and 27 posts. That's almost 2K
shy of what it should be.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
http://www.Access.QBuilt.com/html/ex...ributors2.html for contact info.
"David W. Fenton" <XX*******@dfen ton.com.invalid wrote in message
news:Xn******** *************** ***********@127 .0.0.1...
"'69 Camaro" <Fo************ **************@ Spameater.orgZE RO_SPAM>
wrote in news:Zt******** *************** *******@adelphi a.com:
>However, Google Groups has been cleaning out its archives. A lot
of messages and threads are gone. About 40% of my posts aren't
listed in advanced searches, so I suppose anyone who's been
posting for several years or more probably has a similar amount
missing.

I can find none of my posts missing going back to 1994. Are you sure
you're looking under the right email addresses?

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/

Dec 29 '06 #36
Hi, David.

And it's not just my own messages that are missing from searches. Messages and
occasionally whole threads are missing from the archive. I've looked for
message ID's I downloaded from my ISP's news server, but couldn't find them in
Google Groups. I've also looked for discussion threads that I'd read a few
years ago and wanted to refresh my memory, but they aren't in Google Groups any
more.

For example, I wanted to review the two discussions on Jet's covered queries
from a few years ago. As I recall, there were two threads of discussions in the
Access newsgroups plus a few threads where covered queries were mentioned, but
not really discussed. I could only find one thread where it was mentioned, but
it wasn't discussed at length. I know that covered queries aren't a hot topic
to discuss in the Access newsgroups, but doesn't it seem like in all these years
it would have been mentioned a good number of times and discussed at length at
least once? Or is this a Twilight Zone episode where I'm the only one who
remembers what "used to be there, I'd swear it!"?

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
http://www.Access.QBuilt.com/html/ex...ributors2.html for contact info.
"'69 Camaro" <Fo************ **************@ Spameater.orgZE RO_SPAMwrote in
message news:LN******** *************** *******@adelphi a.com...
Hi, David.
>Are you sure
you're looking under the right email addresses?

Yes. I've posted under three E-mail addresses, but whether I add those up or
check the count by author as "69 Camaro," the number is a few thousand shy of
the sum of the number of posts in my Outlook Express Sent box, the number
posted through Google Groups, and the number posted through Microsoft Online
Communities. I have proof of nearly 5,500 posts, all as '69 Camaro. There's
a few hundred more, but I'd have to go through old backups for proof.

This lists 3,440 posts (but at least 7 aren't mine):

http://groups.google.com/groups?as_q...=2006&safe=off

The profile (E-mail address) for the most recent post shows only 3,565 posts.
The other two address profiles show 100 posts and 27 posts. That's almost 2K
shy of what it should be.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
http://www.Access.QBuilt.com/html/ex...ributors2.html for contact info.
"David W. Fenton" <XX*******@dfen ton.com.invalid wrote in message
news:Xn******** *************** ***********@127 .0.0.1...
>"'69 Camaro" <Fo************ **************@ Spameater.orgZE RO_SPAM>
wrote in news:Zt******** *************** *******@adelphi a.com:
>>However, Google Groups has been cleaning out its archives. A lot
of messages and threads are gone. About 40% of my posts aren't
listed in advanced searches, so I suppose anyone who's been
posting for several years or more probably has a similar amount
missing.

I can find none of my posts missing going back to 1994. Are you sure
you're looking under the right email addresses?

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/


Dec 29 '06 #37
"'69 Camaro" wrote
I've found I've learned much from the denizens
of the Access newsgroups. We have some very
talented and generous experts who post here.
You, Larry, and Lyle are three of them.
Thanks for the very kind words, Gunny.

Larry Linson
Microsoft Access MVP
Dec 29 '06 #38
"'69 Camaro" <Fo************ **************@ Spameater.orgZE RO_SPAM>
wrote in news:Bs******** *************** *******@adelphi a.com:
And it's not just my own messages that are missing from searches.
Messages and occasionally whole threads are missing from the
archive. I've looked for message ID's I downloaded from my ISP's
news server, but couldn't find them in Google Groups. I've also
looked for discussion threads that I'd read a few years ago and
wanted to refresh my memory, but they aren't in Google Groups any
more.
There was a time when Google (or Dejanews) restored the archives
from copies they got from all over, and they weren't honoring
No-Archive headers -- they later removed all of those. Have you ever
used that?

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Dec 29 '06 #39
Hi, David.
they weren't honoring
No-Archive headers -- they later removed all of those. Have you ever
used that?
No. But here's something I noticed way back when Google Groups first became
"groups-beta.google.com " near the end of 2004. I'd search a topic, such as an
error message, and not get nearly as many hits as I expected. Then I'd do the
same search at groups.google.c a or groups.google.c o.uk, and those searches
revealed 5% to 35% more results, as if they were searching a different database
of posts. Eventually, all the other English-speaking Google domains switched to
the same search methodology as the first groups-beta did and inherited the new
Google Groups interface and what looked like (to me) fewer posts to search from
than they'd had before the changeover.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
http://www.Access.QBuilt.com/html/ex...ributors2.html for contact info.
"David W. Fenton" <XX*******@dfen ton.com.invalid wrote in message
news:Xn******** *************** ***********@127 .0.0.1...
"'69 Camaro" <Fo************ **************@ Spameater.orgZE RO_SPAM>
wrote in news:Bs******** *************** *******@adelphi a.com:
>And it's not just my own messages that are missing from searches.
Messages and occasionally whole threads are missing from the
archive. I've looked for message ID's I downloaded from my ISP's
news server, but couldn't find them in Google Groups. I've also
looked for discussion threads that I'd read a few years ago and
wanted to refresh my memory, but they aren't in Google Groups any
more.

There was a time when Google (or Dejanews) restored the archives
from copies they got from all over, and they weren't honoring
No-Archive headers -- they later removed all of those. Have you ever
used that?

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/

Dec 29 '06 #40

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
4521
by: jain-neeraj | last post by:
Hi, We have a problem in our mobile calls billing software. To solve it, I need an outer join in a complicated query. Following are the simplified tables with sample data: create table CONTROL1 (CTRL_NO number(2)); insert into CONTROL1 values (10); create table CONTROL2 (CTRL_NO number(2));
2
16741
by: michael | last post by:
Gotta post because this is driving me nuts. Trying to DELETE orphans. I can successfully: SELECT GroupID FROM Groups LEFT JOIN Users ON UsersID = UserID WHERE UsersID IS NULL; but when I try: DELETE FROM Groups LEFT JOIN Users ON UsersID = UserID WHERE UsersID
4
1371
by: Denis St-Michel | last post by:
Hello All, Hope some Guru will be able to help me with this. Let's take this example table A ------------------------------------------------------------------------------- id | TicketNo | evaluation | Username ------------------------------------------------------------------------------- 1 1 9 Jamie 2 1 8.5 ...
3
2204
by: Andy Visniewski | last post by:
Should be easy, but I've been trying to figure this out for about half an hour with no luck. There is a table 'Cybex' which has all the Cybex products we sell, and a table 'Datasheets' which contains a list of the datasheets available for products. Both tables have a PartNumber column. On with the problem. If i do SELECT * FROM Cybex, it lists the 1000 or so products. and then SELECT * FROM DataSheets, it lists the 800 datasheets we...
16
2665
by: cody | last post by:
I have to write an algorithm with must ensure that objects are put in buckets (which are always 4 in size). The objects have two properties: A and B. It is not allowed that in a bucket are objects with the same A or B value. But there can be more than one object with A = null or B = null in the bucket. Sometimes there is only one valid solution, sometimes there are more valid solutions, and sometimes there isn't a complete solution at...
8
19601
by: Andrew McNab | last post by:
Hi folks, I have a problem with an MS Access SQL query which is being used in an Access Report, and am wondering if anyone can help. Basically, my query (shown below) gets some records from a couple of tables in my database using INNER JOINS and the WHERE clause to specify the required constraints. However, I also want to read two fields from a *single* record from a table called 'Locations' and then apply one of these field's values...
4
2486
by: algroth | last post by:
Hi! I try to do a nested inner join by sql, but I always get an "Syntax-error in FROM-clause". The statement I try around with is: SELECT * FROM st1 INNER JOIN st2 INNER JOIN st3
8
2009
by: Daz | last post by:
Hi everyone. I was faced with the choice of whether my problem is indeed a PHP problem or a MySQL. I have decided it's a PHP problem as I don't experience the same problem when I execute the same query at the CLI. I am having trouble executing a large query through my PHP script. It takes about 7-11 seconds on average to execute, whereas the same query only takes 0.01 seconds to execute through the CLI.
9
5760
by: HC | last post by:
Hello, all, I started out thinking my problems were elsewhere but as I have worked through this I have isolated my problem, currently, as a difference between MSDE and SQL Express 2005 (I'll just call it Express for simplicity). I have, to try to simplify things, put the exact same DB on two systems, one running MSDE and one running Express. Both have 2 Ghz processors (one Intel, one AMD), both have a decent amount of RAM (Intel system...
0
9480
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10093
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9952
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7500
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6740
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5381
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3654
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2880
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.