Posted by MC on 12/05/05 12:18
Yes, it works if you're running the query for one employee. I thought you
needed something for all employees or something like that. Oh well, as long
as you managed to solve the problem :).
MC
<teddysnips@hotmail.com> wrote in message
news:1133776339.305365.292690@g14g2000cwa.googlegroups.com...
>
> MC wrote:
>> Here si one way of doing it.
>>
>> SELECT *
>> FROM tblTest
>> WHERE
>> fldCLocktime = (select max(ClockTime) from tblTest where clocktime <
>> '02/01/2005 12:34' and fldEmployeeID = 1)
>> AND
>> fldEmployeeID = 1
>
> Hi MC
>
> Your response put me onto another way that doesn't use a sub-query:
>
> SELECT TOP 1 *
> FROM tblTest WHERE fldClocktime <
> '02/01/2005 12:34' and fldEmployeeID = 1
> ORDER BY fldClocktime DESC
>
> Both methods work fine - thanks for your help.
>
> Edward
>
[Back to original message]
|