If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Delphi, C etc > Oledb Db_e_errorsincommand

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-31-09, 15:29
bfp bfp is offline
Registered User
 
Join Date: Jul 2009
Posts: 12
Oledb Db_e_errorsincommand

I'm trying to execute the following query via ICommandText->Execute:

SELECT A.ID
FROM A
LEFT OUTER
JOIN B
ON B.ID = A.ID
LEFT OUTER
JOIN C
ON C.ID = A.ID + B.CSEQS
GROUP
BY A.ID
, A.SubTotal
HAVING (A.SubTotal - COALESCE(SUM(C.TranAmount),0) > 100 AND A.SubTotal - COALESCE(SUM(C.TranAmount),0) < 200)

I'm getting an incorrect syntax error yet this command runs fine in mgmt studio.

Any suggestions?
Reply With Quote
  #2 (permalink)  
Old 07-31-09, 18:13
bfp bfp is offline
Registered User
 
Join Date: Jul 2009
Posts: 12
oledb db_e_errorsincommand

Doh!!!

I was executing this via a stored procedure passing in the query as a parameter. I didn't have a big enough buffer...sigh.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On