
May 13th, 2008, 04:00 AM
|
|
Contributing User
|
|
Join Date: Aug 2005
Posts: 290
Time spent in forums: 10 h 19 m 34 sec
Reputation Power: 3
|
|
|
Database - Recordset - Syntax error (missing operator) in query expression 'SUM
Hi All,
I know this might be a SQL syntax problem, but i really need to sort this thing out asap, hope someone can tell me and help me fix this problem.
i have a script to sum up a certain column value, i got a do loop to print out few column value sum up, and below is my sql to do the thing,
Code:
sql3="select SUM("&temp_gift&") as total from DailyGifts where datelist2 <="&temp
where temp_gift is a variable that keep on changing in my loop, i noticed that if the temp_gift is a variable with a single word like "giftA", my sql will be ok, but when temp_gift is multiple word like "gift A model A" then my sql statement will give me the error messages
Error Type:
Microsoft JET Database Engine (0x80040E14)
Syntax error (missing operator) in query expression 'SUM(gift A model A)'.
Anyone know how to solve it? Thanks in advanced...
|