SQL problem in query (Left Join with 2 conditions)

G

Guest

I coded this query in SQL designer:

SELECT Q.*, D.TargetDate, D.InProgress, D.ActualDate
FROM qryDatesForPkg1 AS Q LEFT JOIN tblPkgDates AS D ON (Q.ID = D.DateTypeID
AND D.PkgID = [Forms]![frmPackages]![PkgID])
ORDER BY D.TargetDate DESC , Q.ReqSW;

It saves and works perfectly. However, when I open up the query again the
parentheses around the AND clause disappear and the query refuses to save
until I put them back. Can I code this any other way?
 
G

Guest

Try this instead

SELECT Q.*, D.TargetDate, D.InProgress, D.ActualDate
FROM qryDatesForPkg1 AS Q LEFT JOIN tblPkgDates AS D ON Q.ID = D.DateTypeID
Where D.PkgID = [Forms]![frmPackages]![PkgID]
ORDER BY D.TargetDate DESC , Q.ReqSW;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top