-
Dec 1st, 2015, 10:03 AM
#1
Thread Starter
Frenzied Member
last entries
I have this DTR record. Employees have daily IN and OUT.
I have this query select dtrdate,empid from DTR group by dtrdate desc,empid order by dtrdate desc limit 1 on mysql db.
the problem with this is I get only for one employee. What I need to achieve is to get the last IN entries for all the employees.
On ms access, I think that is Last().
What is the proper way of the sql statement.
Last edited by codesearcher; Dec 1st, 2015 at 10:10 AM.
-
Dec 1st, 2015, 12:11 PM
#2
Re: last entries
Does this work for you?
Code:
select dtrdate, empid from DTR group by dtrdate, empid order by dtrdate desc
Just guessing without seeing your table
-
Dec 2nd, 2015, 02:30 PM
#3
Fanatic Member
Re: last entries
Remove / ditch the 'limit 1' and use proper where clause, which selects only IN entries and limit those with max(date) or similar.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|