Date -week-year calculated in asp.net using sql server

Posted by Dn2010 under ASP.NET on 2/16/2011 | Points: 10 | Views : 1507 | Status : [Member] | Replies : 3
hi friends,

how to create like this in asp.net using sql server

ex:

suppose i registered a page before 2 months 1 week.

after 2 months 1 week, details shown


you are registered 2 months, 1 week ago

updated Today.

like this

please give in detail.

thanks.




Responses

Posted by: Naimishforu on: 2/16/2011 [Member] [MVP] Bronze | Points: 25

Up
0
Down
It's pretty simple.

You need to store the registered date somewhere in your database or storage location.

Match today's date with registered date, find the difference between two. simple!!!

Thanks,
Naimish
http://dotnetinterview.zxq.net/
http://naimishpandya.blogspot.in/

Dn2010, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Madhu.b.rokkam on: 2/16/2011 [Member] [MVP] Bronze | Points: 25

Up
0
Down
You can write a small function to convert the date difference as suggested by naimish into words as you need.

Thanks and Regards
Madhu

Dn2010, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Karthikanbarasan on: 2/16/2011 [Member] [Moderator] [Microsoft_MVP] [MVP] Silver | Points: 25

Up
0
Down
Hi,

Save the date when the user registerd with the site. When showing in the front end use the code logic to check how many days and change it appropriately in words.



Thanks
Karthik
www.f5Debug.net

Dn2010, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response