Extracting month from date using Linq
Extracting month from date using Linq
(OP)
Hi,
I need help extracting the month from my date column. The date is returned in this format 2012-07-06.
what I would like to do is filter the date based on the month only so return all the data for July etc.
This is what I have
Thanks in advance
I need help extracting the month from my date column. The date is returned in this format 2012-07-06.
what I would like to do is filter the date based on the month only so return all the data for July etc.
This is what I have
CODE -->
string value = HttpContext.Current.Session["Value "].ToString(); string Month = ""; if (value == "1") { Month = "July"; } else Month ="August"; var query = from row in dt.AsEnumerable() where row by row.["Date_Column"] == Month ; <--- Also not sure to use this where ((row.Field<string>("Date_Column") == Month)) <--or this
Thanks in advance
RE: Extracting month from date using Linq
CODE