insert into test
values (10005, 'mar 26, 2013', 'apr 02, 2013', 8)
insert into test
values (10006, 'Feb 26, 2000', 'March 02, 2000', 6)
select * from test
select empid
, substring(datename(mm, fdate), 1, 3) +' - '+ convert(varchar(2),
day((dateadd(mm, 1, fdate)- day(dateadd(mm, 1, fdate)))) -
day(fdate)+1) nextmonth
, substring(datename(mm,tdate),1,3) +' - '+ convert(varchar(2),
day(tdate)), noofdays
from test where empid like '10005'
query output
empid nextmonth thismonth nodays
10005 Jan-6 feb-2 8
10005 mar-6 apr-2 8
here i will split the days between two months....my problem is i want to execute this in vb.net,,i am having dropdownlist in that dropdownllist i am having a list of month january to december and another dropdownlist i used to select the empid...
if i select the month january in first dropdownlist and select the empid as 10005 in the second dropdownlist,i want to display the days for january 6 in the textbox,and if i select the febraruy month and employee id is 10005 i want to display 2days in textbox,,,can anyone tell me.query is working properly but i want to retrive like my format...can anyone pls help me..