On Wed, 14 Apr 2004 16:59:31 -0400, wrote: >You need to drop the parenthesis. It looks you are trying to do a join >on a sub-join, and you appear to be missing a join condition. Or you're >trying to create a join with multiple conditions, which if fine. Near >as I can tell, you've made this a lot more complicated than it should. >I'm not sure I know what you are trying to do. > >Try this: >SELECT i.*, p.ProjectName, si.OrderBy, si.editable, >tbl_SubProject.SubProjectName >FROM tbl_Project AS p >INNER JOIN tbl_Invoice AS i ON p.ProjectID = i.ProjectID) >INNER JOIN tbl_InvoiceStatus AS si ON si.InvoiceStatus = i.InvoiceStatus >LEFT JOIN tbl_SubProject ON i.SubProjectID = tbl_SubProject.SubProjectID > WHERE i.InvoiceStatus = '#strInvoiceStatus#' > AND i.ProjectID =#intProjectID# > AND i.SubProjectID =#intSubProjectID# > AND i.Deleted = 0 > Order BY si.Orderby,i.InvoiceNumber > >I moved your tbl_InvoiceStatus join to after the tbl_Invoice join. I >think using alias names for your tables is throwing you off since it's >affecting your join order. Meaning, to read it properly you need to >alias the table before you reference it in any join condition. >
>> To unsubscribe: >> http://lists.mysql.com/[EMAIL PROTECTED] >> >> >-- >Brent Baisley >Systems Architect >Landover Associates, Inc. >Search & Advisory Services for Advanced Technology Environments >p: 212.759.6400/800.759.0577 Brent, Will try that out, I inherited the code, and am also a Join Newbie, it did work on MSAccess that's all I know zzapper (vim, cygwin, wiki & zsh) -- vim -c ":%s/^/WhfgTNabgureRIvzSUnpxre/|:%s/[R-T]/ /Ig|:normal ggVGg?" http://www.vim.org/tips/tip.php?tip_id=305 Best of Vim Tips -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]