Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: (untagged)
Dear Sir,

I have a database Table(sql server 2005 and asp.net(c#)) In which a column store date , I have accessed that date by sql and now I want to increament that accessed that and display in detailview.(e.g. i have accessed 1/1/2011 now i want to display this date by increamenting 1 or 2 according to need(after increamenting 1 of accessed date it should be 2/1/2011)).

Pls Suggest me how it is possible.

Pls help me out.

Thanks
Abhishek
Posted
Updated 9-Jun-11 20:27pm
v2

1 solution

try this,
Here I will find out the date after 2 days from today,

SELECT CONVERT(VARCHAR(10), GETDATE()+2, 105) AS date

--------------------------------------------------------------------------------------------------------
Updated code,

To findout the date after 10 days retrived from column 'Date' in my table Table_1,
SQL
select CONVERT(VARCHAR(10),dateadd(day,10,Date),105) as date from Table_1 where ID=1

To findout the date after 10 months retrived from column 'Date' in my table Table_1,
select CONVERT(VARCHAR(10),dateadd(month,10,Date),105) as date from Table_1 where ID=1



--------------
@Nidhish
 
Share this answer
 
v5
Comments
abhiamity86 10-Jun-11 4:49am    
Thanks For reply,
i dont want this,I want to display date after some day or some month of date that has been accessed from database.
THanks
N!dh!sh 10-Jun-11 5:35am    
try the updated code given under solution 1..

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