Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NETSQLServer
Hi.. i hav used date of birth with datatype as datetime.. and in design i am inputting textbox using ajax calendar extender.. Now after inserting to database i am getting the output as 2012-07-09 00:00:00.000.. I needed help in removal of time from this column.. please provide the solution.
 
Regards
sarthi
Posted 7-Dec-12 17:25pm
Edited 7-Dec-12 18:21pm
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Why Dont You Convert your DateTime like
select CONVERT(VARCHAR(8),  current_timestamp, 5) AS TodayDate
Place your DateOf Birth Field in place of current_timestamp
  Permalink  
Comments
Member 7767311 at 8-Dec-12 0:44am
   
hi my column is dob datetime.. how to use ur query select CONVERT(VARCHAR(8), current_timestamp, 5) AS TodayDate.. i m using ur query as select CONVERT(VARCHAR(8), dob, 5) AS TodayDate.. i m getting invalid column error
Karwa_Vivek at 8-Dec-12 0:49am
   
use like this select CONVERT(VARCHAR(8), dob, 5) AS BirthDate from tablename add the Tablename also .the name of your table containg the dob field
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Make date of birth's datatype as Date instead of DateTime...
  Permalink  

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

  Print Answers RSS
0 Dnyaneshwar@Pune 1,300
1 Sergey Alexandrovich Kryukov 660
2 OriginalGriff 329
3 ravikhoda 300
4 Manas Bhardwaj 240
0 Sergey Alexandrovich Kryukov 11,194
1 OriginalGriff 6,867
2 Peter Leow 4,795
3 Abhinav S 3,838
4 Maciej Los 3,575


Advertise | Privacy | Mobile
Web02 | 2.8.140421.2 | Last Updated 8 Dec 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid