Re: help with join please
From: Uri Dimant (urid_at_iscar.co.il)
Date: 02/27/05
- Next message: jester: "RE: Performance: TOP vs. SET ROWCOUNT"
- Previous message: wira659: "Query Data using Date"
- In reply to: Williams: "help with join please"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 27 Feb 2005 07:58:20 +0200
Williams
I'm not sure that understand you. Can you post DDL + smaple data + expected
result?
Perhaps you need to use INNER JOIN instead of LEFT.
"Williams" <DianaValdezW@prodigy.net.mx> wrote in message
news:OWYWvFHHFHA.2456@TK2MSFTNGP09.phx.gbl...
> (first off sorry if in wrong forum -- if so please let me know which is
> best)
>
> Its been a long time since I have done this and need some help! Basically
I
> have two tables that I want to join using a query that works in both SQL 7
> and Jet. Here is the select statement I am using:
>
> PARAMETERS [StartDate] DateTime, [EndDate] DateTime, [Employee] Text;
> SELECT L.WorkDate, L.Pay, L.Tips, A.AdvAmount
> FROM tblLabor AS L LEFT JOIN tblAdvances AS A ON (L.WorkDate =
> A.AdvanceDate) AND (L.Employee = A.Employee)
> WHERE L.WorkDate BETWEEN [StartDate] AND [EndDate] AND L.Employee =
> [Employee]
> ORDER BY L.WorkDate
>
> This works great except when I have more than one record in tblLabor with
> the same date & employee (like a split shift) -- because then a single
> records from tblAdvances gets joined to each record in tblLabor with the
> same date.
>
> I hope this makes sense and thanks in advance for your help!
>
> Diana
>
>
- Next message: jester: "RE: Performance: TOP vs. SET ROWCOUNT"
- Previous message: wira659: "Query Data using Date"
- In reply to: Williams: "help with join please"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|