SunQuest
 
           ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingASP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
You eat, breathe and sleep innovation. Build your mobile intelligence with BlackBerry® experts this July. Register Today!
  #1  
Old May 13th, 2008, 04:00 AM
sinner8347 sinner8347 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2005
Posts: 290 sinner8347 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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...

Reply With Quote
  #2  
Old May 13th, 2008, 04:11 AM
micky's Avatar
micky micky is offline
Couch Potato Wizard
Click here for more information. Click here for more information
 
Join Date: Jan 2005
Location: India
Posts: 10,179 micky User rank is General 6th Grade (Above 100000 Reputation Level)micky User rank is General 6th Grade (Above 100000 Reputation Level)micky User rank is General 6th Grade (Above 100000 Reputation Level)micky User rank is General 6th Grade (Above 100000 Reputation Level)micky User rank is General 6th Grade (Above 100000 Reputation Level)micky User rank is General 6th Grade (Above 100000 Reputation Level)micky User rank is General 6th Grade (Above 100000 Reputation Level)micky User rank is General 6th Grade (Above 100000 Reputation Level)micky User rank is General 6th Grade (Above 100000 Reputation Level)micky User rank is General 6th Grade (Above 100000 Reputation Level)micky User rank is General 6th Grade (Above 100000 Reputation Level)micky User rank is General 6th Grade (Above 100000 Reputation Level)micky User rank is General 6th Grade (Above 100000 Reputation Level)micky User rank is General 6th Grade (Above 100000 Reputation Level)micky User rank is General 6th Grade (Above 100000 Reputation Level)micky User rank is General 6th Grade (Above 100000 Reputation Level)  Folding Points: 1480 Folding Title: Novice Folder
Time spent in forums: 3 Months 3 Weeks 1 Day 16 h 36 m 26 sec
Reputation Power: 1413
do u have a field named gift A model A in ur database table?
If yes, then wrap it with [] like SUM[gift A model A] in sql.
Comments on this post
sync_or_swim agrees!
__________________
Laziness is my religion and Sunday is my God

Get the Mantra!

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingASP Development > Database - Recordset - Syntax error (missing operator) in query expression 'SUM


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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 On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway