I have table called MCALLERS on my database that has column which called CallDate, datatype is datetime stored data as 2016-02-01 17:01:00.000
on my web Form I have dropdownlist which is populating month and year as March-2016.
how to convert datetime into month and year when I search data.I want to search data from database using Month and year as (March-2016). I'm sing C#.
Thanks in advance
what I have tried
select BusinessCallYN,CallID,NewNam,CallDate,CalledNo,CallExt,CallDuration,Amount,tmpNewNam from MCALLERS where UserName='"+txtEmail+"' and CallDate>='"+cmddropdownlist1+"' and CallDate<'"+cmddropdownlist1+"' and Amount>0 order by CallDate
Pramod ThakurPosted Mar 30, 2016, 6:09 AM
Lucas NgobeniPosted Mar 30, 2016, 2:55 AM
Pramod ThakurPosted Mar 29, 2016, 10:19 PM
ali tuncerPosted Mar 29, 2016, 11:57 AM
select YEAR(CallDate),Month(CallDate),DATENAME(Month, CallDate) AS 'Month Name'
from MCALLERS
will display year, month number,month name like 2016 3 March