TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Basit Khan
NA
336
122.6k
How to get the Year in between two dates
Apr 6 2016 3:33 AM
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.
Reply
Answers (
2
)
How to find value from comma seperate
group by with inner join sqlserver