Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

unterminated string constant

Status
Not open for further replies.

gtubb

Programmer
Jan 15, 2004
24
GB
Hi

I have constructed the following SQL statement using the graphical query tool in Access (the query works fine).

sql_fields ="SELECT categories.category_name AS categories_category_name, Count(items.category_name) AS items_category_name
FROM items INNER JOIN categories ON items.category_name = categories.category_name
GROUP BY categories.category_name
HAVING (((Count(items.category_name))<>0))
ORDER BY Count(items.category_name)&quot;

I have enclosed it in &quot;s and removed the semicolon from the end, but all I get is an 'unterminated string constant' error message after 'Count(items.category_name)'

Am I doing something obvious wrong?

Gerard
 
try change &quot;having&quot; to &quot;where&quot; as it may use slightly different syntax within access to how sql statements work through asp pages.

Just a thought.

daveJam
 
Davejam

Tried that and it didn't work. It was the most obvious thing: I'd cut a pasted the code from the graphical query tool - which had introduced line breaks into the code.

My stupid fault.

Gerard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top