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. |
|
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|