Good morning friends,
how to avoid time portion from the datetime variable ?
i dont want to use it by converting tostring() methord.
any other way to avoid the time portion. i am getting the value like 1/12/2015 12:00:00
i need the date only.
please help me to find out the solution
Thanks

Manish Kumar ChoudharyRank #339 · 7.4K reputationPosted Jan 23, 2015, 6:17 PM EST
Manish Kumar ChoudharyRank #339 · 7.4K reputationPosted Jan 23, 2015, 6:01 PM EST
If you are using sql server change data type to Date in place of DateTime it will give you only date.
Manish Kumar ChoudharyRank #339 · 7.4K reputationPosted Jan 23, 2015, 6:02 PM EST
Use the Date property:
var dateAndTime = DateTime.Now;
var date = dateAndTime.Date;
shiju kv72 reputationPosted Jan 23, 2015, 6:03 PM EST
Manish Kumar ChoudharyRank #339 · 7.4K reputationPosted Jan 23, 2015, 6:05 PM EST
shiju kv72 reputationPosted Jan 23, 2015, 6:09 PM EST
Manish Kumar ChoudharyRank #339 · 7.4K reputationPosted Jan 23, 2015, 6:11 PM EST
shiju kv72 reputationPosted Jan 23, 2015, 6:14 PM EST
when i open the show table data the time is not added with it .
but when i load to a report it shows
Manish Kumar ChoudharyRank #339 · 7.4K reputationPosted Jan 23, 2015, 6:16 PM EST
show me your report query ?
shiju kv72 reputationPosted Jan 23, 2015, 6:19 PM EST
shiju kv72 reputationPosted Jan 23, 2015, 6:20 PM EST
Manish Kumar ChoudharyRank #339 · 7.4K reputationPosted Jan 23, 2015, 6:22 PM EST
Go through following link and modify your data in report viewer
http://stackoverflow.com/questions/9140630/how-to-remove-the-time-and-display-the-date-only-in-rdlc
Manish Kumar ChoudharyRank #339 · 7.4K reputationPosted Jan 23, 2015, 6:26 PM EST
Change date format in report viewer
=IIF(Year(Fields!DATE_SENT.Value)=1900,"-",Format(CDate(Fields!DATE_SENT.Value),"yyyy-MM-dd"))
shiju kv72 reputationPosted Jan 23, 2015, 6:33 PM EST