Dušan Pavlica <[EMAIL PROTECTED]> wrote on 10/12/2005 10:00:53 AM:

> Thanks, Michal, for your help.
> Your query works as I need.
> I tried to use same syntax as in MS Access, but results are for some 
reason 
> different for this query. I'm working on application which should be 
able to 
> connect to MySQL or to MSAccess (users' choice) and I didn't want to 
write 
> querries for each DB system separately. Now I see that I will have to.
> 
> Dusan
> 
> ----- Original Message ----- 
> From: "Michael Stassen" <[EMAIL PROTECTED]>
> To: "Dušan Pavlica" <[EMAIL PROTECTED]>
> Cc: "list mysql" <mysql@lists.mysql.com>
> Sent: Wednesday, October 12, 2005 2:54 PM
> Subject: Re: Help with query
> 
> 
> > Dušan Pavlica wrote:
> >> Hello,
> >>
> >> could someone help me please to construct correct query or tell me 
what 
> >> I'm doing wrong?
<snip>
> >> Kind regards,
> >> Dusan Pavlica
> >
<snip>
> > In any case, does this do what you want?
> >
> >   SELECT p.Description, p.ID, pp.Product_ID, pc.Code, pp.StartDate
> >   FROM products_prices pp
> >   JOIN products p ON p.ID = pp.Product_ID
> >   LEFT JOIN products_codes pc ON p.ID = pc.Product_ID AND pc.CodeType 
= 1
> >   WHERE StartDate < Now()
> >   ORDER BY p.ID, pp.StartDate DESC;
> >
> > Michael
> >
> >

I don't think you will need to change anything. MS Access should be able 
to work with Michael's query just fine. Just because the Query Builder in 
Access (I despise the SQL that comes out of that tool) always nests its 
JOINs doesn't mean that MS Access can't use un-nested joins. Give it a 
shot, you may be surprised.

Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine

Reply via email to