Sorry to ask again.
If you can't tell I am a little new to writing SQL statements.
I created a couple new queries on the same table for different fields and
they worked fine by switching out the field name and the criteria.
I am trying to make one for the [Employee] field but am having no luck.
Here is the statement
SELECT Assets.[Asset ID], Assets.[Section Name], Assets.Employee,
Assets.[Product Type], Assets.[Serial Number], Assets.MFG, Assets.[Model
Number], Assets.[Equipment Condition], Assets.[Equipment Use], Assets.[PO
Number], Assets.[Fiscal Year], Assets.Index, Assets.PCA, Assets.[Invoice
Number], Assets.[Acquistion Date], Assets.Cost, Assets.[Dispostion Status],
Assets.[Dispostion Date], Assets.[Useful Life], Assets.[Salvage Value],
Assets.Comments, Grant.[Grant ID]
FROM Assets LEFT JOIN (PaysFor LEFT JOIN [Grant] ON PaysFor.[Grant ID] =
Grant.[Grant ID]) ON Assets.[Asset ID] = PaysFor.[Asset ID]
WHERE (((Assets.Employee) Like [Enter Employee Name: ] & "*"));
Again Thanks
Eric
KARL DEWEY said:
Try this --
FROM (Assets LEFT JOIN PaysFor ON Assets.[Asset ID] = PaysFor.[Asset ID])
LEFT JOIN [Grant] ON PaysFor.[Grant ID] = Grant.[Grant ID]
WHERE (((Assets.[Section Name]) Like "Comm*"));
--
Build a little, test a little.
:
Sorry for the misunderstanding
SELECT Assets.[Asset ID], Assets.[Section Name], Assets.Employee,
Assets.[Product Type], Assets.[Serial Number], Assets.MFG, Assets.[Model
Number], Assets.[Equipment Condition], Assets.[Equipment Use], Assets.[PO
Number], Assets.[Fiscal Year], Assets.Index, Assets.PCA, Assets.[Invoice
Number], Assets.[Acquistion Date], Assets.Cost, Assets.[Dispostion Status],
Assets.[Dispostion Date], Assets.[Useful Life], Assets.[Salvage Value],
Assets.Comments, Grant.[Grant ID]
FROM [Grant] INNER JOIN (Assets INNER JOIN PaysFor ON Assets.[Asset ID] =
PaysFor.[Asset ID]) ON Grant.[Grant ID] = PaysFor.[Grant ID]
WHERE (((Assets.[Section Name]) Like "Comm*"));
Eric
:
As Karl requested, show us the SQL. Open the query in design view. Next go
to View, SQL View and copy and past it here.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.
:
The Field Name is [Section]
Searching for all records with "Communication & Information Services"
Used - Like "Comm*" - for criteria in both original table and copy(without
Auto#)
Eric
:
Post the SQL of the query you tried on the table with Autonumber.
--
Build a little, test a little.
:
I seem to be having a problem with getting my query to run the way I want. I
have a table of records that has an autonumber field on it as a PK. The query
I am trying to run is one that pulls all records with a certain criteria on
different field then the autonumber field, but I get now records in return. I
think it might have something to do with the autonumber field. So to test it
I created a copy of the table with out the autonumber field and the query
then worked.
I would like to retain the autonumber field because I use it to link other
tables, but I don’t know how to get the query to run correctly.
I would appreciate any help I can get,
Thanks
Eric