Re: Syntax error (missing operator) in query expression
- From: "Gary Walter" <forgetit@xxxxxxxxxxxxxxxxx>
- Date: Fri, 7 Jul 2006 01:49:10 -0500
First, if it works for you in Query Analyzer,
then save that SQL as a passthrough and enjoy
how it "snaps back" the results (if that can work
for you).
Else, Jet query joins typically are
INNER JOIN
LEFT JOIN
RIGHT JOIN
plus, here's a snip from an old post
from John Viescas:
****quote****
The SQL Standard allows for both bracketed and non-bracketed syntax, but
requires brackets when the ON clause doesn't immediately follow the JOIN
clause. A FROM clause must consist of a <table-expression>.
<snip>
Personally, I find it much clearer to enclose each pair of base tables
inside parentheses, treat that as one "logical table", and then add the next
table and JOIN-ON clause. So, I would write it like this:
((((a inner join b on a.x = b.x)
inner join c on a.x = c.x)
inner join d on a.x = d.x)
left join e on a.x = e.x)
left join f on a.x = f.x
***unquote*****
this might do you.....
SELECT
dbo_mainCustomer_Florida.customerID,
qDRI2.tDRI2,
qDRISF.tDRISF,
qRRI.tRRI,
dbo_mainCustomer_Florida.agencyName,
dbo_mainCustomer_Florida.state,
dbo_mainCustomer_Florida.availCredits
FROM
dbo_mainCustomer_Florida
INNER JOIN
[SELECT
customerID,
COUNT(*) tDRI2
FROM
((dbo_mainCustomer_Florida MC
INNER JOIN
dbo_evaluators2_Florida EV
ON
MC.customerID = EV.Customer_ID)
INNER JOIN
dri2_Offenders DRI2
ON
EV.password = DRI2.userpassword)
WHERE
Cdate(DRI2.testDate)
BETWEEN #5/5/2005# AND #5/5/2006#
GROUP BY
customerID]. qDRI2
ON
dbo_mainCustomer_Florida.customerID = qDRI2.customerID
LEFT JOIN
[SELECT
customerID,
COUNT(*) tDRISF
FROM
((dbo_mainCustomer_Florida MC
INNER JOIN
dbo_evaluators2_Florida EV
ON
MC.customerID = EV.Customer_ID)
INNER JOIN
drisf_Offenders DRISF
ON
EV.Password = DRISF.userpassword)
WHERE
cdate(DRISF.testDate)
BETWEEN #5/5/2005# AND #5/5/2006#
GROUP BY
customerID]. qDRISF
ON
dbo_mainCustomer_Florida.customerID = qDRISF.customerID
LEFT JOIN
[SELECT
customerID,
COUNT(*) tRRI
FROM
((dbo_mainCustomer_Florida MC
INNER JOIN
dbo_evaluators2_Florida EV
ON
MC.customerID = EV.Customer_ID)
INNER JOIN
rri_Offenders RRI
ON
EV.Password = RRI.userpassword)
WHERE
Cdate(RRI.testDate)
BETWEEN #5/5/2005# AND #5/5/2006#
GROUP BY
customerID]. qRRI
ON
dbo_mainCustomer_Florida.customerID = qRRI.customerID
.
- Prev by Date: Re: Can't figure out a Query
- Next by Date: Re: Syntax error (missing operator) in query expression
- Previous by thread: Can Access to "FULL OUTER JOINS"?
- Next by thread: Re: Syntax error (missing operator) in query expression
- Index(es):
Relevant Pages
|
|