talamar
|
| Posted: 12/20/2004, 4:30 PM |
|
I keep getting this error when trying to use the CCDLookup Function.
Source: CCDLookUp function
Command Text: SELECT PostHeight FROM Product Weights WHERE Product = SS-40 6
Error description: Syntax error (missing operator) in query expression 'Product = SS-40 6'. (Microsoft JET Database Engine)<br>
My Access table structure is like this:
RecID pK AutoNumber
ProductID Number
Product Text
PostHeight Number
WeightPerFoot Number
DollarsPerTon Currency
EstValuation Currency
No matter what column I try to retrieve from this table, I get the same error (PostHeight, WeightPerFoot OR DollarsPerTon). Can anyone offer any advice?
|
|
|
 |
peterr
Posts: 5971
|
| Posted: 12/20/2004, 4:52 PM |
|
You need to create valid SQL syntax.
Your database reports that this syntax is invalid, probably because quotes are missing around the product name: "SELECT PostHeight FROM Product Weights WHERE Product = SS-40 6".
If you experience other problems with SQL, you can copy your SQL statement directly into your database and possibly the database will show you more details about what's wrong.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
 |
 |
talamar
|
| Posted: 12/20/2004, 5:04 PM |
|
Peter:
That did it... Thanks. I was using the line "Product = " & Projects.Product.Value
When it should have been:
"Product = " & """ & Projects.Product.Value & """
Thanks a million!
talamar
Quote peterr:
You need to create valid SQL syntax.
Your database reports that this syntax is invalid, probably because quotes are missing around the product name: "SELECT PostHeight FROM Product Weights WHERE Product = SS-40 6".
If you experience other problems with SQL, you can copy your SQL statement directly into your database and possibly the database will show you more details about what's wrong.
"Product = " & """ & Projects.Product.Value & """ "Product = " & Projects.Product.Value
|
|
|
 |
nebde
Posts: 3
|
| Posted: 12/21/2004, 1:18 AM |
|
try to use this line
"Product = " & CCToSQL(Projects.Product.Value,"Text")
instead of "Product = " & Projects.Product.Value
_________________
Regards,
nebde |
 |
 |
|