How to query with both JOIN and aliases in Access?
- From: "Oscar" <oku@xxxxxxxxx>
- Date: Sun, 15 Apr 2007 06:03:13 +0200
I am converting the following query from SQL Server to MS Access.
The following query fires a 'missing operator' message within my VB IDE.
strSQL = "Select w.empID " _
& " FROM tabEmp w INNER JOIN tblArbCtr c ON w.empID = c.wrnID WHERE " &
selStr & " AND c.contract <> 0 AND c.datumStart <= " & datumStr & " AND
c.datumEind >= " & datumStr & " LEFT OUTER JOIN (SELECT empID, max(datum)
AS LastDayWorked FROM tabGewerkt GROUP BY empID) v ON w.empID = v.empID
LEFT OUTER JOIN (SELECT wrnID,min(datumStart) AS FirstDayWorked FROM
tblArbCtr WHERE contract <> 0 GROUP BY wrnID) v2 ON w.empID = v2.wrnID "
It looks like Access can't cope with the aliases v and v2 after the
parantheses, but I'm not sure about that and don't know how it needs to be
written for MS Access.. Please help.
Oscar
.
- Prev by Date: Re: Accounting Database Structure
- Next by Date: Re: Show all rows...Please help...
- Previous by thread: How do I select records were a field contains a key word??
- Next by thread: Re: How to query with both JOIN and aliases in Access?
- Index(es):