![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have imported a dbf table into mssql in a char format 19720628. How can I convert nvarchar to datetime? |
#3
| |||
| |||
|
|
Hi, Does 19720628 means 1972-06-28 as a date or is it a number? -- Danijel Novak MCP+I, MCSA, MCSE, MCDBA, MCT "Devibez" <Devibez (AT) discussions (DOT) microsoft.com> wrote in message news:FDB32DD8-9A67-4E27-91B3-09534AAE8CEE (AT) microsoft (DOT) com... I have imported a dbf table into mssql in a char format 19720628. How can I convert nvarchar to datetime? |
#4
| |||
| |||
|
#5
| |||
| |||
|
|
DECLARE @str varchar(10) SET @str = '19720628' SELECT CONVERT(datetime, @str, 101) |
#6
| |||
| |||
|
|
Thanks! How can I convert all the rows in a column using the method? "GlennThomas5" wrote: DECLARE @str varchar(10) SET @str = '19720628' SELECT CONVERT(datetime, @str, 101) |
#7
| |||
| |||
|
|
You can do an update: UPDATE table SET <datefield> = CONVERT(datetime, <datefield>, 101) "Devibez" wrote: Thanks! How can I convert all the rows in a column using the method? "GlennThomas5" wrote: DECLARE @str varchar(10) SET @str = '19720628' SELECT CONVERT(datetime, @str, 101) |
#8
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |