Home MS SQL Server - How to generate end date for each line item
Reply: 0

MS SQL Server - How to generate end date for each line item

user826
1#
user826 Published in May 25, 2018, 2:19 pm

In the table, I have emp_id, rate_effective_date and hourly_rate columns, however, there is no rate_effective_end_date column.

Please help me with a query that generate rate_effective_end_date for each line item.

The rate_effective_end_date will be calculated from next rate_effective_date -1 for any given employee.

Emp id  | rate_effective_date | hourly_rate | rate_effective_end_date 
--------+---------------------+-------------+------------------------
1       | 01/01/17            | 50          | 06/29/17
1       | 06/30/17            | 55          | 09/30/17
1       | 10/01/17            | 45          | 12/31/17
1       | 01/01/18            | 60          | {null}
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.344188 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO