Click here to Skip to main content
15,895,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hellooo,

i am making a report in asp.net with c# . there is a one field which i use to store datetime.

i use Select query in Command field of crystal report. so i return all the values from the table. i make one formula filed to display that time. but it display whole record as datetime:


so what i write to remove time from that datetime value. i want to display only date not time.

Please help me..

Thanks in advance...
Mitesh
Posted

Use datatime data type and pass just date part from CR or strip off the time part wherever you are planning to use it.

declare @d datetime<br />
<br />
set @d = getdate()<br />
<br />
select dateadd(day, datediff(day, 0, @d), 0)<br />
<br />
go
 
Share this answer
 
You can try something like:
C#
String date = DateTime.Parse( "DB_DateTimeValue" ).ToString( "yyyy/MM/dd" );
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900