Re: Please Help with database upate. New to database




OdAwG wrote:
I didn't do a good job of explaining on what it is I am trying to do. I am
new to databases and doing alot of reading and OJT.

This is what I am trying to do: I need to search a table or query for
specific information. I am given a list to use as my search criteria to
search that master query. The list is given to me in a text file. I import
that text file into my database as tbl_UserSearch and I want to do the
following:

001. I want to use tbl_UserSearch to search the Master_query
002. Find all matches and create a new table called tbl_MatchesFound.
003. tbl_MatchesFound is created and used to export the information to
Excel to be used by others.
004. The other items not found is ported to a new table called
tbl_NoMatches
005. tbl_NoMatches is used to inform the requestors that those items not
found need to be worked.

tbl_MatchesFound and tbl_NoMatches do not have to be tables, I guess they
could be queries as long as I can export that data into excel.

again, all help is greatly appreciated.

Argus

Oh, I get it now. So you essentially have a "temporary" dataset (your
newly imported data) and you have to see what it matches/does not
match? If that's the case, you can create queries to do all this for
you. If the records exist in two tables, you can just have a join
between them. Given tables A and B, in Oracle-speak, it would look
like this:

SELECT tblA.Field1, tblB.Field2 <whatever fields you want to see>
FROM tblA, tblB
WHERE tblA.Field1 = tblB.Field2; <---- these are your inner joins

If you want to find the records that are in one table but not in
another, just use an outer join (that's what the find unmatched query
wizard does).

It's something like:

SELECT tblA.Field1, ...
FROM tblA LEFT JOIN tblB ON tblA.Field1=tblB.Field2
WHERE tblB.SomeField IS NULL;

The data that's not in table B will be Null, so you can find on that if
there are no matches.

So there's no need for any other table than your real data tables (the
"temp" one and your "existing records" one). You can export the
queries wherever you want. Just treat them like tables. I think the
only difference is that you specify the type as table instead of query.
Other than that, everything works the same.

.



Relevant Pages

  • Re: merge multiple databases
    ... Well, as YYZ said, I myself tried built in queries in the Access database ... databases, I need to do everything through DAO. ... I ended up> with an internal Access Make Table query and then a> ton of update queries. ...
    (microsoft.public.vb.general.discussion)
  • Re: merge multiple databases
    ... Well, as YYZ said, I myself tried built in queries in the Access database ... databases, I need to do everything through DAO. ... I ended up> with an internal Access Make Table query and then a> ton of update queries. ...
    (microsoft.public.access.queries)
  • Re: merge multiple databases
    ... Well, as YYZ said, I myself tried built in queries in the Access database ... databases, I need to do everything through DAO. ... I ended up> with an internal Access Make Table query and then a> ton of update queries. ...
    (microsoft.public.vb.database.dao)
  • Re: Different MSSQL output date format from the same PHP script
    ... Especially when "SELECT *" queries just do have their uses. ... And the fact your programs and databases evolve makes it even more important to specify column names. ... You wouldn't want to ever want to, say, run a query returning all ... You may think it's not bad, but many other, more experienced programmers will tell you it is. ...
    (comp.lang.php)
  • Re: Please Help with database upate. New to database
    ... tables or query. ... FROM tblA, tblB ... FROM tblA LEFT JOIN tblB ON tblA.Field1=tblB.Field2 ... queries wherever you want. ...
    (comp.databases.ms-access)