December 1, 2006 at 2:20 pm
I need to compare data in a table and I don't know how to do this.
I have a table with an employee number, code, and number of hours.
I need a query that will give me the employee number, code, and number of hours from the table, but if the employee is in the table twice...I only need the record with lower number of hours. (some employee are in the table twice with different amount of hours)
December 1, 2006 at 2:58 pm
Oops, my bad. That will not work. Will your Code values be the same for the employees and only the hours different? If so use
SELECT Empoyee#, Code, MIN(Hours) FROM YourTable GROUP BY Employee#, Code
If not, how do you want to handle those differences?
December 2, 2006 at 8:55 am
that was simple...thank you much
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply