SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseSQL 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:
  #1  
Old November 24th, 2003, 06:52 AM
Buckers Buckers is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 36 Buckers User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 14 h 12 m 57 sec
Reputation Power: 6
Angry SQL Syntax Error

Help please an ASP/SQL beginner!

I'm trying to create a Crosstab table on an ASP page from Access 2000 and can't get the Transform Statement past the Syntax Error stage. My SQL (taken from the Crosstab Query in Access with attempt to modify) is as follows:

strSQL = "TRANSFORM Sum(OrdersMexico.Quantity) AS SumOfQuantity"& _
"SELECT ProgrammeMexico.DepotDate, ProgrammeMexico.DepotDay"& _
"FROM ProgrammeMexico INNER JOIN (Products INNER JOIN OrdersMexico ON Products.ProductID = OrdersMexico.ProdID) ON ProgrammeMexico.ProgrammeMexID = OrdersMexico.ProgMexID"& _
"GROUP BY ProgrammeMexico.DepotDate, ProgrammeMexico.DepotDay"& _
"ORDER BY ProgrammeMexico.DepotDate, Products.ProdRef"& _
"PIVOT Products.ProdRef;"

The message on the displayed page is:

Error: -2147217900
Description: [Microsoft][ODBC Microsoft Access Driver] Syntax error in TRANSFORM statement.

Please help
Thanks

Reply With Quote
  #2  
Old November 24th, 2003, 05:04 PM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 13
I don't know if this will help, but I haver noticed that if I don't have a space before the ", I get errors

For Example:

SumOfQuantity"& _

Should Be

SumOfQuantity "& _

Tyr this and let me know.

S-

Reply With Quote
  #3  
Old November 25th, 2003, 05:02 AM
Buckers Buckers is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 36 Buckers User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 14 h 12 m 57 sec
Reputation Power: 6
Thanks very much. It worked.

David

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseSQL Development > SQL Syntax Error


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 3 hosted by Hostway
Stay green...Green IT