Tech
Forums
Jobs
Books
Events
Videos
Conference
Annual Conference
Bcrypt
Ai Conference
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
2
Answers
How to get the Year in between two dates
basit khan
8y
444
1
Reply
Dear,
I have leave table
The Fields are
EmpNo
EmpName
LeaveStart
LeaveEnd
I want to show the leave taken by year.
i use datediff(dd,LeaveStart,LeaveEnd) it will shows the no. of days have taken.
but i want to show yearly wise.
E.g
2014 - 10 days
2015 - 16 days
how & where i can use year function becoz have leavestart & leaveend
suppose if employee taken a leave
LeavStart- 28-Dec-2015
LeaveEnd - 05-Jan-2016
then result should
2015 - 4 days
2016 - 5 days
then how to use query.
please help on this
Thanks
Basit.
Post
Reset
Cancel
Answers (
2
)
Next Recommended Forum
How to find value from comma seperate
group by with inner join sqlserver