Click here to Skip to main content
15,887,596 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi
i have to field in table like join date and second is leave date and my problem is how to get experience in two date in using procedure
thanks
Posted

Use DateDiff
 
Share this answer
 
to get exact difference
visit link...
Get Duration Between Two Dates in Years, Months, Days, and Hours using SQL Server[^]
Happy Coding!
:)
 
Share this answer
 
use this SP for Your need...


SQL
create proc Exp_proc
as
select datediff(YYYY,'join_date','leave_date') from TableName
go
 
Share this answer
 
use the following function in your stored procedure...

datediff(YYYY,'01/01/2012','01/01/2013')
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900