table vs. query

  • Thread starter Thread starter tracktraining
  • Start date Start date
T

tracktraining

Hi All,

Can anyone tell me if there is a difference between using a table or a query
in a SELECT statement?

case 1. Temp is a table
SELECT * FROM Temp blah blah ....

case 2. Temp is a query
SELECT * FROM Temp blah blah....

Thanks,
Tracktraining.
 
You can use either (table or query) as the "source" for a new query.

Have you tried this out?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
tracktraining said:
Hi All,

Can anyone tell me if there is a difference between using a table or a
query
in a SELECT statement?

case 1. Temp is a table
SELECT * FROM Temp blah blah ....

case 2. Temp is a query
SELECT * FROM Temp blah blah....

Thanks,
Tracktraining.

No difference other than the obvious - the query you're basing the new query
on has presumably restricted the data returned.
 
Then is there any differences in these cases:

case 1) Temp is a table
SELECT * FROM Temp blah blah ....

case 2) Temp is a query that get its data from a table that is linked via
ODBC
SELECT * FROM Temp blah blah....

if the Temp table and the temp query has the same exact information, then
the the query from case 1 and case 2 would be the same right?

In my situation, query from case 1 and case 2 are not the same.

Any help is appreciated.
 
Your satements are the same. Bear in mind that the query is already
filtering. You can use a select statement that includes the query.

Query1: select * from tablename where ID = 1

Select command: select * from query1 where FullName = "Name"

Alternative Select Command: select * from tablename where ID = 1 and
FullName = "Name"
 
More information:

I am running out of possible reason for the problem. Please help. Let me try
to explain.

Background information:
EmpdocStatus table --- has all the record assigned to each employee.
Update form -- has only the doc+latest rev assigned to each employee (from
the latestRev query)
DocInfo table --- contain doc+revision

Case 1). DocInfo table is a table that is part of the db. First I assign the
doc+revision to employee. Then I change the revision of a doc, then assign
the doc+new revision to the same employee. So my LatestRev query return back
the latest rev assign to that employee. So that works great.

Case 2). I delete the DocInfo table. I link a table called [Part Master] via
odbc. Then I write a query called DocInfo to get Doc+revision from the part
master table (so this should act like the DocInfo table from Case 1). Then I
assign an employee a document+ current revision. It shows up on the UPDATE
form. Then I maually change the revision to a higher revision (i.e. from A to
B) in the part master table. Then I assign this doc+new revision to the same
employee. Now my UPDATE form doesn't give me the latest rev. it is still
showing the old revision.

So I don't know what is the problem with my
latestrev query? Why doesnt' it work like before I linked the part master
table?

Please help.
 
You are asking if there is a difference, and you are saying "the problem",
but I don't have a very clear picture of what you have to start with nor
what is working incorrectly.

One possibility: if you use a query as a source, and if the query uses a
join between tables, perhaps that join is a "equi-join", that only shows
records when the key fields are IN BOTH tables.

Regards

Jeff Boyce
Microsoft Office/Access MVP


tracktraining said:
More information:

I am running out of possible reason for the problem. Please help. Let me
try
to explain.

Background information:
EmpdocStatus table --- has all the record assigned to each employee.
Update form -- has only the doc+latest rev assigned to each employee (from
the latestRev query)
DocInfo table --- contain doc+revision

Case 1). DocInfo table is a table that is part of the db. First I assign
the
doc+revision to employee. Then I change the revision of a doc, then assign
the doc+new revision to the same employee. So my LatestRev query return
back
the latest rev assign to that employee. So that works great.

Case 2). I delete the DocInfo table. I link a table called [Part Master]
via
odbc. Then I write a query called DocInfo to get Doc+revision from the
part
master table (so this should act like the DocInfo table from Case 1). Then
I
assign an employee a document+ current revision. It shows up on the UPDATE
form. Then I maually change the revision to a higher revision (i.e. from A
to
B) in the part master table. Then I assign this doc+new revision to the
same
employee. Now my UPDATE form doesn't give me the latest rev. it is still
showing the old revision.
that
is linked via
So I don't know what is the problem with my
latestrev query? Why doesnt' it work like before I linked the part master
table?

Please help.

--
Learning


Jeff Boyce said:
What happens when you try these?

Regards

Jeff Boyce
Microsoft Office/Access MVP

message
 
Back
Top