![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I can't seem to find a method of converting a CHAR(8) column in the form of YYYYMMDD to an actual date such as mm/dd/yyyy Can anyone point me in the right direction? Thanks |
#3
| |||
| |||
|
|
I can't seem to find a method of converting a CHAR(8) column in the form of YYYYMMDD to an actual date such as mm/dd/yyyy Can anyone point me in the right direction? Thanks |
#4
| |||
| |||
|
|
Correction the source field in an INT type So how to convert INT type YYYYMMDD to a date mm/dd/yyyy |
#5
| |||
| |||
|
|
"rdraider" <rdraider (AT) sbcglobal (DOT) net> wrote in message news:5_nzi.11029$3x.7225 (AT) newssvr25 (DOT) news.prodigy.net... Correction the source field in an INT type So how to convert INT type YYYYMMDD to a date mm/dd/yyyy DECLARE @dt INT; SET @dt = 20070823; SELECT CAST(CAST(@dt AS CHAR(8)) AS DATETIME) AS dt; -- David Portas, SQL Server MVP Whenever possible please post enough code to reproduce your problem. Including CREATE TABLE and INSERT statements usually helps. State what version of SQL Server you are using and specify the content of any error messages. SQL Server Books Online: http://msdn2.microsoft.com/library/m...S,SQL.90).aspx -- |
#6
| |||
| |||
|
|
'YYYYMMDD' is one of the standard, non-regional formats supported by SQL Server. No special conversion is necessary: |

#7
| |||
| |||
|
|
'YYYYMMDD' is one of the standard, non-regional formats supported by SQL Server. No special conversion is necessary: Picky, picky, but the proper term is "ISO-8601 Standard" and the Standard SQL format is "yyyy-mm-dd" from that Standard ![]() |
#8
| |||
| |||
|
|
Conversion necessary because the &%#%$&)# user wants to see mm/dd/yyyy |
#9
| |||
| |||
|
|
Conversion necessary because the &%#%$&)# user wants to see mm/dd/yyyy Thanks |
#10
| |||
| |||
|
|
Conversion necessary because the &%#%$&)# user wants to see mm/dd/yyyy |
![]() |
| Thread Tools | |
| Display Modes | |
| |