Trouble with Query Results

E

Eric Starn

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
 
E

Eric Starn

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
 
J

Jerry Whittle

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.

Eric Starn said:
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

KARL DEWEY said:
Post the SQL of the query you tried on the table with Autonumber.
 
E

Eric Starn

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

Jerry Whittle said:
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.

Eric Starn said:
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

KARL DEWEY said:
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
 
K

KARL DEWEY

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.


Eric Starn said:
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

Jerry Whittle said:
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.

Eric Starn said:
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
 
E

Eric Starn

Works like a charm

Thank you

If I understand this right
If I want to create another query on the same table using a different field
and criteria I just need to change the, WHERE (((Assets.[Section Name]) Like
"Comm*"));, string to show the new field and criteria
Example: WHERE (((Assets.[Product Type]) Like "Camera*"));

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.


Eric Starn said:
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

Jerry Whittle said:
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
 
E

Eric Starn

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.


Eric Starn said:
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

Jerry Whittle said:
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
 
K

KARL DEWEY

I am trying to make one for the [Employee] field but am having no luck.
Is that how much information you give the Vet for a sick dog? Don't you
tell what symptoms are?
What does it do? What does it not do you are expecting?

--
Build a little, test a little.


Eric Starn said:
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.


Eric Starn said:
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
 
E

Eric Starn

Ok, the table is an Asset that holds all records of assets for my company.
Assets being Computers, Monitors, etc.
With your help I have now created a query that gives me records for a
specific section, one for specific Asset Type, and one to search by Serial
Number
Now I am trying to create one that searches for records from the [Employee]
field using a parameter entered by the user.
When I run the query and enter a known Employee name in to dialog box all
get is a blank record but when I leave the the dialog box empty and select ok
it expectedly returns all records.

Eric

KARL DEWEY said:
I am trying to make one for the [Employee] field but am having no luck.
Is that how much information you give the Vet for a sick dog? Don't you
tell what symptoms are?
What does it do? What does it not do you are expecting?

--
Build a little, test a little.


Eric Starn said:
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
 
K

KARL DEWEY

Are your other queries returning a name or employee ID?
Do you by chance have an Employee table that has a primary key other than
name?
Maybe instead of Asset table using employee name it is using the employee ID
or Code.
Or is Assets.Employee a Lookup field in the table?

Try running this query --
SELECT Assets.Employee
FROM Assets
WHERE (((Assets.Employee) Like [Enter Employee Name: ] & "*"));


--
Build a little, test a little.


Eric Starn said:
Ok, the table is an Asset that holds all records of assets for my company.
Assets being Computers, Monitors, etc.
With your help I have now created a query that gives me records for a
specific section, one for specific Asset Type, and one to search by Serial
Number
Now I am trying to create one that searches for records from the [Employee]
field using a parameter entered by the user.
When I run the query and enter a known Employee name in to dialog box all
get is a blank record but when I leave the the dialog box empty and select ok
it expectedly returns all records.

Eric

KARL DEWEY said:
I am trying to make one for the [Employee] field but am having no luck.
Is that how much information you give the Vet for a sick dog? Don't you
tell what symptoms are?
What does it do? What does it not do you are expecting?

--
Build a little, test a little.


Eric Starn said:
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

:

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
 
E

Eric Starn

Hello Karl,
I hope you had a nice weekend.

The Employee Query in now working.

It appears it had something to do with the Lookup Field like you suggested.

So I removed it and got rid of the link between the Asset table and the
Employee table and off it went.

Thanks for all your help in answering all my questions.

Eric


KARL DEWEY said:
Are your other queries returning a name or employee ID?
Do you by chance have an Employee table that has a primary key other than
name?
Maybe instead of Asset table using employee name it is using the employee ID
or Code.
Or is Assets.Employee a Lookup field in the table?

Try running this query --
SELECT Assets.Employee
FROM Assets
WHERE (((Assets.Employee) Like [Enter Employee Name: ] & "*"));


--
Build a little, test a little.


Eric Starn said:
Ok, the table is an Asset that holds all records of assets for my company.
Assets being Computers, Monitors, etc.
With your help I have now created a query that gives me records for a
specific section, one for specific Asset Type, and one to search by Serial
Number
Now I am trying to create one that searches for records from the [Employee]
field using a parameter entered by the user.
When I run the query and enter a known Employee name in to dialog box all
get is a blank record but when I leave the the dialog box empty and select ok
it expectedly returns all records.

Eric

KARL DEWEY said:
I am trying to make one for the [Employee] field but am having no luck.
Is that how much information you give the Vet for a sick dog? Don't you
tell what symptoms are?
What does it do? What does it not do you are expecting?

--
Build a little, test a little.


:

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

:

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top