Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET SQL Server
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 18:25pm
Edited 7-Dec-12 19: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 OriginalGriff 230
1 PIEBALDconsult 150
2 DamithSL 125
3 Andreas Gieriet 90
4 Jochen Arndt 90
0 OriginalGriff 5,790
1 DamithSL 4,601
2 Maciej Los 4,012
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,195


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

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100