Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 7129

Question with Query

$
0
0

Hello all,

This might be simple for a experienced user. I wrote a query in my sql 2000 database, to retrieve records. The query looks like this.

select employee.employeeLName,employee.employeefname,employeepay.badgeNumber,
from employee
INNER JOIN employeepay
ON employee.employeeid=employeepay.employeeid;

Since this is our payroll database, everytime a user is changed whether its , pay rate, fulltime-partime, etc, it updates a new record within the database. So when I run this query it pulls like 10 or so records of each employee. There is a column in the employeepositions table that is Effectivedate. I need to write this exact query but have it pull the records of only the newest effective date for each employee? Any help would be great!


Viewing all articles
Browse latest Browse all 7129

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>