Click here to Skip to main content
15,906,569 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hai all,

I have one datatable with one datetime datatype column, what i want to do is in that column i have to be displayed date only .

Please help me how to attain it.
Posted
Comments
hitech_s 19-Sep-11 8:40am    
u want to store both date and time while displaying for the user you want date only ...is it right?

C#
string str = DateTime.Now.ToString("dd MMM yyyy");
 
Share this answer
 
u want to store both date and time while displaying for the user you want date only ...is it right?

if so

while getting the date do this
select convert(varchar,DATE,103) from tablename
 
Share this answer
 
you have to display only date in SQL table column right ?

but as u give datatype "DateTime". bydefault your time will append with date. (12:00:00AM)
change column datatype to Varchar either.
 
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