Database Management
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsDatabasesDatabase Management

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 Dev Shed Forums Sponsor:
  #1  
Old May 28th, 2012, 02:19 PM
EGD Eric EGD Eric is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2012
Posts: 3 EGD Eric User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 43 m 8 sec
Reputation Power: 0
Syntax error (missing operator), what missing operator?

I'm trying to perform an sql query, but I get an error that unfortunately, doesn't tell me much. I haven't done databases in a while, maybe it will be more obvious to you!

I've got 2 tables: One for Clients, one for payments. I'm trying to get the total amount of money owed for each Client that has authorized prepayments (via void cheque or whatever), ignoring those that prefer to pay with cash or cheque.

Code:
  
SELECT PAYMENT.num, SUM(PAYMENT.AMOUNT) As Total, PAYMENT.Client, PAYMENT.acct
FROM PAYMENT 
GROUP BY PAYMENT.num
INNER JOIN  
ON PAYMENT.num = Client.NUM
WHERE PAYMENT.AMOUNT > 0 AND Client.Prepay = 'Yes';


The reason for the inner join is that I need to cross-reference the client to know if he's authorized prepay.

I get this error: Syntax error (missing operator) in expression: PAYMENT.num INNER JOIN
ON PAYMENT.num = Client.NUM
WHERE PAYMENT.AMOUNT > 0 AND Client.Prepay = 'Yes';

Any SQL wizards in the house? I'm at a loss here...

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesDatabase Management > Syntax error (missing operator), what missing operator?

Developer Shed Advertisers and Affiliates



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 | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap