getting confusion in calendar coding

Posted by Rama127 under ASP.NET on 11/25/2011 | Points: 10 | Views : 676 | Status : [Member] | Replies : 1
In my webform i have one calendar control(fromdate) and one textbox which is for entering healthtips... In my table i have 3
columns (one is: healthtips,fromdate and todate)..... I am inserting data into the database.... for the first time the todate column
should be like open(like if users selects today's date then todate column in database should show as open, next time the
user selects date as 3/12/2011 the previous todate should show as 2/12/2011 in database).... I am getting confusion in doing...


Posted by: Rama127 on: 11/28/2011 [Member] Starter | Points: 25

CREATE Procedure Proc-name

declare i int;
declare id2 int;
insert into tbl_healthtips (Healthtips,Fromdate,Todate)
values (iHealthtips,DATE_FORMAT(STR_TO_DATE(iFromdate, '%m/%d/%Y'),'%d-%m-%Y'),iTodate);
select id from tbl_healthtips where Healthtips = iHealthtips and Fromdate = DATE_FORMAT(STR_TO_DATE(iFromdate, '%m/%d/%Y'),'%d-%m-%Y') into i;
update tbl_healthtips set Todate = DATE_FORMAT(DATE_SUB(STR_TO_DATE(iFromdate, '%m/%d/%Y'),INTERVAL 1 DAY),'%d-%m-%Y') where id=i-1;

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

Login to post response