473,805 Members | 1,949 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Assistance Required - Syntax.

------=_NextPart_000_ 002B_01C34DF8.C 34C94F0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Assistance required.

I have 3 tables:

TABLE: client_invoice
- client_id *1(show all from client_invoice, only those w/ info from =
client_info)
- invoice_amount
- invoice_date_du e

TABLE: client_info
- client_id *1(show all from client_invoice, only those =
w/ info from client_info)
- client_city
- client_state *2(show all from client_info, only those w/ =
match from client_info)
- client_country *3(show all from client_info, only those w/ =
match from client_info)
- apply_tax

TABLE: tax_zones
- tid
- countries_iso_2 *3 (show all from client_info, only those w/ match =
from client_info)
- tax_zone *2(show all from client_info, only those w/ =
match from client_info)
- tax_amount
- tax_desc
- tax_status
(if I was drawing this on paper, or creating it in access, I would join =
based on the *'s above)
Here's the select query, I'm attempting to use....

SELECT client_invoice. client_id, client_invoice. invoice_amount, =
client_invoice. invoice_date_du e, client_info.cli ent_city, =
client_info.cli ent_state, client_info.cli ent_country, =
client_info.app ly_tax, tax_zones.count ries_iso_2, tax_zones.tax_z one, =
tax_zones.tax_a mount, tax_zones.tax_d esc, tax_zones.tax_s tatus, =
(1-(tax_zones.tax_ amount/100)) AS BillRate, =
if(client_info. apply_tax=3D0,( client_invoice. invoice_amount-(client_invoi=
ce.invoice_amou nt*BillRate)),0 ) AS Amt_taxed FROM tax_zones RIGHT JOIN =
(client_info RIGHT JOIN client_invoice ON =
client_info.cli ent_id=3Dclient _invoice.client _id) ON =
(tax_zones.tax_ zone=3Dclient_i nfo.client_stat e) AND =
(tax_zones.coun tries_iso_2=3Dc lient_info.clie nt_country)
I'm getting the following error: You have an error in your SQL syntax =
near '(client_info RIGHT JOIN client_invoice ON =
client_info.cli ent_id=3Dclient _invoice.c'=20
any ideas as to how to fix the syntax of this query? I'm sure it's =
something simple, but I'm still a newbie to MySQL.

Kevin Michael Reed
kr***@tnolnet.c om
President
TNOLnet.com

------=_NextPart_000_ 002B_01C34DF8.C 34C94F0--

Jul 19 '05 #1
0 1173

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1045
by: Kevin Michael Reed | last post by:
------=_NextPart_000_002B_01C34DF8.C34C94F0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Assistance required. I have 3 tables:
22
1643
by: Daniel Antonson | last post by:
Fellow programmers, As one of you pointed out, I've been taking 3 online courses (2 are done) and have run into a time crunch. I started these courses in Oct04, but between work (US Army in DC), caring for my wife (stroke in Dec03 due to lupus complications) & daughter (4), and preparing for transfer/deployment (my stepson,- 23, says he'll care for them during my absence). I've had little time for anything else. I would greatly...
1
2199
by: Dalan | last post by:
I'm experiencing a Query Syntax Error with an Access 97 Db. Actually, the query performs as expected when adding any new records or editing existing ones and even deleting records, EXCEPT when the last record on any related subform is deleted, then it generates a Runtime Error 3075 - Syntax error (missing operator) in query expression 'IDRef = '-- of course, because there are no more records left with the same IDRef number, or none...
8
1559
by: Daniel Antonson | last post by:
Fellow programmers, As one of you pointed out, I've been taking 3 online courses (2 are done) and have run into a time crunch. I started these courses in Oct04, but between work (US Army in DC), caring for my wife (stroke in Dec03 due to lupus complications) & daughter (4), and preparing for transfer/deployment (my stepson,- 23, says he'll care for them during my absence). I've had little time for anything else. I would greatly...
0
9716
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9596
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10364
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10104
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7645
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6875
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5541
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5677
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3843
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.