Format DateTime selecting date using LINQ

suddu89
 
on Dec 18, 2012 08:57 AM
8294 Views

 Dim d = From Leave In db.trn_Leave_Request Join Emp In db.mst_Employee On Emp.EmplCode Equals Leave.Emp_Code
                        Join Leavetype In db.mst_LeaveType On Leavetype.Id Equals Leave.Leave_Id Order By Leave.Leave_App_Date
                Select New With
                {
                 Leave.Id, Leave.Leave_Month, Leave.Leave_App_Date,Leave.Leave_From_Date,Leave.Leave_To_Date, Emp.EmplName, Leavetype.LeaveDesc, Leave.Leave_Day
                }

in above query i have to use alias name for a column and how to select only date for the column from date and to date

 

please help

Download FREE API for Word, Excel and PDF in ASP.Net: Download
Mudassar
 
on Dec 18, 2012 08:58 AM

Date by default comes with time. You will have to set a Format to it when displayed

 

suddu89
 
on Dec 18, 2012 11:26 AM

Thanks for your reply

 

I dont know how to format and select only date in linq using vb.net