A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Query Not Working



 
 
Thread Tools Display Modes
  #1  
Old June 11th, 2007, 03:30 PM posted to microsoft.public.access.queries
CT[_2_]
external usenet poster
 
Posts: 14
Default Query Not Working

Hello,

I have set up a query for 1 table.

The field I'm trying to run the query on is a text field. I enter a name
(="smith, john") I get zero results. However I have confirmed that this
user exists in the table.

Also (if this helps), this field gets populated via a combo box on a form.
The table being used for the lookup contains a "user" field which is also a
text field

Thanks.



  #2  
Old June 11th, 2007, 03:41 PM posted to microsoft.public.access.queries
David Cox[_2_]
external usenet poster
 
Posts: 57
Default Query Not Working

sometimes this is caused by a leading blank in the field. It displays very
narrow.

one solution sname: TRIM([field])


"CT" wrote in message
...
Hello,

I have set up a query for 1 table.

The field I'm trying to run the query on is a text field. I enter a name
(="smith, john") I get zero results. However I have confirmed that this
user exists in the table.

Also (if this helps), this field gets populated via a combo box on a form.
The table being used for the lookup contains a "user" field which is also
a
text field

Thanks.





  #3  
Old June 11th, 2007, 04:20 PM posted to microsoft.public.access.queries
CT[_2_]
external usenet poster
 
Posts: 14
Default Query Not Working

Thanks,

I've confirmed there are no leading or trailing spaces in the fields. What
else could be going on?


"David Cox" wrote in message
news
sometimes this is caused by a leading blank in the field. It displays very
narrow.

one solution sname: TRIM([field])


"CT" wrote in message
...
Hello,

I have set up a query for 1 table.

The field I'm trying to run the query on is a text field. I enter a

name
(="smith, john") I get zero results. However I have confirmed that this
user exists in the table.

Also (if this helps), this field gets populated via a combo box on a

form.
The table being used for the lookup contains a "user" field which is

also
a
text field

Thanks.







  #4  
Old June 11th, 2007, 06:05 PM posted to microsoft.public.access.queries
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default Query Not Working

Post your SQL.

--
KARL DEWEY
Build a little - Test a little


"CT" wrote:

Thanks,

I've confirmed there are no leading or trailing spaces in the fields. What
else could be going on?


"David Cox" wrote in message
news
sometimes this is caused by a leading blank in the field. It displays very
narrow.

one solution sname: TRIM([field])


"CT" wrote in message
...
Hello,

I have set up a query for 1 table.

The field I'm trying to run the query on is a text field. I enter a

name
(="smith, john") I get zero results. However I have confirmed that this
user exists in the table.

Also (if this helps), this field gets populated via a combo box on a

form.
The table being used for the lookup contains a "user" field which is

also
a
text field

Thanks.








  #5  
Old June 11th, 2007, 06:45 PM posted to microsoft.public.access.queries
CT[_2_]
external usenet poster
 
Posts: 14
Default Query Not Working

Here is the SQL"

SELECT [Table - Mobile Devices].Manufacturer, [Table - Mobile
Devices].Model, [Table - Mobile Devices].[Serial Number], [Table - Mobile
Devices].User
FROM [Table - Mobile Devices]
WHERE ((([Table - Mobile Devices].User)="smith, john"));

Thanks!


"KARL DEWEY" wrote in message
...
Post your SQL.

--
KARL DEWEY
Build a little - Test a little


"CT" wrote:

Thanks,

I've confirmed there are no leading or trailing spaces in the fields.

What
else could be going on?


"David Cox" wrote in message
news
sometimes this is caused by a leading blank in the field. It displays

very
narrow.

one solution sname: TRIM([field])


"CT" wrote in message
...
Hello,

I have set up a query for 1 table.

The field I'm trying to run the query on is a text field. I enter a

name
(="smith, john") I get zero results. However I have confirmed that

this
user exists in the table.

Also (if this helps), this field gets populated via a combo box on a

form.
The table being used for the lookup contains a "user" field which is

also
a
text field

Thanks.










  #6  
Old June 11th, 2007, 07:31 PM posted to microsoft.public.access.queries
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default Query Not Working

Maybe there are other errors as David Cox pointed out so try this --
WHERE ((([Table - Mobile Devices].User) Like "smith*"));

--
KARL DEWEY
Build a little - Test a little


"CT" wrote:

Here is the SQL"

SELECT [Table - Mobile Devices].Manufacturer, [Table - Mobile
Devices].Model, [Table - Mobile Devices].[Serial Number], [Table - Mobile
Devices].User
FROM [Table - Mobile Devices]
WHERE ((([Table - Mobile Devices].User)="smith, john"));

Thanks!


"KARL DEWEY" wrote in message
...
Post your SQL.

--
KARL DEWEY
Build a little - Test a little


"CT" wrote:

Thanks,

I've confirmed there are no leading or trailing spaces in the fields.

What
else could be going on?


"David Cox" wrote in message
news sometimes this is caused by a leading blank in the field. It displays

very
narrow.

one solution sname: TRIM([field])


"CT" wrote in message
...
Hello,

I have set up a query for 1 table.

The field I'm trying to run the query on is a text field. I enter a
name
(="smith, john") I get zero results. However I have confirmed that

this
user exists in the table.

Also (if this helps), this field gets populated via a combo box on a
form.
The table being used for the lookup contains a "user" field which is
also
a
text field

Thanks.











  #7  
Old June 11th, 2007, 07:40 PM posted to microsoft.public.access.queries
CT[_2_]
external usenet poster
 
Posts: 14
Default Query Not Working

Thanks Karl..

Tried that..still returned no results.


"KARL DEWEY" wrote in message
news
Maybe there are other errors as David Cox pointed out so try this --
WHERE ((([Table - Mobile Devices].User) Like "smith*"));

--
KARL DEWEY
Build a little - Test a little


"CT" wrote:

Here is the SQL"

SELECT [Table - Mobile Devices].Manufacturer, [Table - Mobile
Devices].Model, [Table - Mobile Devices].[Serial Number], [Table -

Mobile
Devices].User
FROM [Table - Mobile Devices]
WHERE ((([Table - Mobile Devices].User)="smith, john"));

Thanks!


"KARL DEWEY" wrote in message
...
Post your SQL.

--
KARL DEWEY
Build a little - Test a little


"CT" wrote:

Thanks,

I've confirmed there are no leading or trailing spaces in the

fields.
What
else could be going on?


"David Cox" wrote in message
news sometimes this is caused by a leading blank in the field. It

displays
very
narrow.

one solution sname: TRIM([field])


"CT" wrote in message
...
Hello,

I have set up a query for 1 table.

The field I'm trying to run the query on is a text field. I

enter a
name
(="smith, john") I get zero results. However I have confirmed

that
this
user exists in the table.

Also (if this helps), this field gets populated via a combo box

on a
form.
The table being used for the lookup contains a "user" field

which is
also
a
text field

Thanks.













  #8  
Old June 11th, 2007, 07:58 PM posted to microsoft.public.access.queries
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default Query Not Working

Is this a lookup field by chance? Test it by using 0 as criteria.

If so, then you need add the lookup table and join in your query. Then add
the criteria to the name field of the lookup table.
--
KARL DEWEY
Build a little - Test a little


"CT" wrote:

Thanks Karl..

Tried that..still returned no results.


"KARL DEWEY" wrote in message
news
Maybe there are other errors as David Cox pointed out so try this --
WHERE ((([Table - Mobile Devices].User) Like "smith*"));

--
KARL DEWEY
Build a little - Test a little


"CT" wrote:

Here is the SQL"

SELECT [Table - Mobile Devices].Manufacturer, [Table - Mobile
Devices].Model, [Table - Mobile Devices].[Serial Number], [Table -

Mobile
Devices].User
FROM [Table - Mobile Devices]
WHERE ((([Table - Mobile Devices].User)="smith, john"));

Thanks!


"KARL DEWEY" wrote in message
...
Post your SQL.

--
KARL DEWEY
Build a little - Test a little


"CT" wrote:

Thanks,

I've confirmed there are no leading or trailing spaces in the

fields.
What
else could be going on?


"David Cox" wrote in message
news sometimes this is caused by a leading blank in the field. It

displays
very
narrow.

one solution sname: TRIM([field])


"CT" wrote in message
...
Hello,

I have set up a query for 1 table.

The field I'm trying to run the query on is a text field. I

enter a
name
(="smith, john") I get zero results. However I have confirmed

that
this
user exists in the table.

Also (if this helps), this field gets populated via a combo box

on a
form.
The table being used for the lookup contains a "user" field

which is
also
a
text field

Thanks.














  #9  
Old June 11th, 2007, 08:15 PM posted to microsoft.public.access.queries
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Query Not Working

On Mon, 11 Jun 2007 13:45:01 -0400, "CT" wrote:

Here is the SQL"

SELECT [Table - Mobile Devices].Manufacturer, [Table - Mobile
Devices].Model, [Table - Mobile Devices].[Serial Number], [Table - Mobile
Devices].User
FROM [Table - Mobile Devices]
WHERE ((([Table - Mobile Devices].User)="smith, john"));


Let me hazard a guess he the field User in [Table - Mobile Devices] is a
Lookup field.

If it is, then what the table contains is NOT "smith, john", but rather a
concealed numeric foreign key to the lookup table.

This problem you're having is one of many reasons a lot of us really dislike
the lookup wizard.

John W. Vinson [MVP]
  #10  
Old June 11th, 2007, 09:13 PM posted to microsoft.public.access.queries
CT[_2_]
external usenet poster
 
Posts: 14
Default Query Not Working

User in [Table - Mobile Devices] is a text field.

On the form I use a combo box to do a lookup on a table named STAFF and have
the selected value stored in the USER field from the Mobile Devices table.




"John W. Vinson" wrote in message
...
On Mon, 11 Jun 2007 13:45:01 -0400, "CT" wrote:

Here is the SQL"

SELECT [Table - Mobile Devices].Manufacturer, [Table - Mobile
Devices].Model, [Table - Mobile Devices].[Serial Number], [Table - Mobile
Devices].User
FROM [Table - Mobile Devices]
WHERE ((([Table - Mobile Devices].User)="smith, john"));


Let me hazard a guess he the field User in [Table - Mobile Devices] is

a
Lookup field.

If it is, then what the table contains is NOT "smith, john", but rather a
concealed numeric foreign key to the lookup table.

This problem you're having is one of many reasons a lot of us really

dislike
the lookup wizard.

John W. Vinson [MVP]



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 03:32 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.