I have date of "Joining" and I need to find "length of service" from it
in this format like this 3years 1 month 5 days
date of joining in datetime format
Using sqlserver 2005 with asp.net c#
any 1 can help and thanks in advance
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jitendra TiwariPosted Mar 29, 2010, 2:38 PM
i don't understand ur query
to calculate year,month,day try this code
DateTime startDate = Convert.ToDateTime("10-jan-2000");
DateTime endDate = Convert.ToDateTime("10-feb-2010");
TimeSpan diff = endDate.Subtract(startDate);
diff calculate total days.
calculate year,month,days from this diff.
thanks
pls mark ans if help u.
Sam HobbsPosted Mar 29, 2010, 2:06 PM