Dian D. Chapman wrote:

>The last query in this monster...but I need help, please!
>
>I'm getting: Syntax Error (missing operator) 
>
>And I'm not sure I'm doing the join correctly???
>
>My eye are crossing and I can't figure out what I'm messing up now. Really
>appreciate some help...
>
>  gstrSQLQuery = _
>      "SELECT * FROM Referrals WHERE (" _
>          & "(Referrals.TellerID=" & "'" & strSingleTeller & "') " _
>          & "AND (Referrals.Sales='True') " _
>          & "AND (Referrals.ReturnDate BETWEEN (" _
>          & "'" & varReportFromDate & "' AND " _
>          & "'" & varReportToDate & "'))" _
>          & ") INNER JOIN Customer ON Referrals.CustomerID=" _
>          & "Customer.CustomerID ORDER BY TellerID"
>  
>
Inner join goes before the Where clause.

It's also generally not a great idea to do select *, but I think that 
stands even more when you start doing joins.

Cheers

manzo


------------------------ Yahoo! Groups Sponsor --------------------~--> 
$4.98 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/Q7_YsB/neXJAA/yQLSAA/17folB/TM
--------------------------------------------------------------------~-> 

---------------------------------------------------------------------    
 Home       : http://groups.yahoo.com/group/active-server-pages
---------------------------------------------------------------------
 Post       : [EMAIL PROTECTED]
 Subscribe  : [EMAIL PROTECTED]
 Unsubscribe: [EMAIL PROTECTED]
--------------------------------------------------------------------- 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/active-server-pages/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to