how to convert varchar into smalldatatime
From: new (anonymous_at_discussions.microsoft.com)
Date: 09/16/04
- Previous message: anonymous_at_discussions.microsoft.com: "How to Convert Character String to Numeric- Thanks!"
- Next in thread: Vishal Parkar: "Re: how to convert varchar into smalldatatime"
- Reply: Vishal Parkar: "Re: how to convert varchar into smalldatatime"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 16 Sep 2004 13:07:03 -0700
I import text file into SQL table, one column
name 'date', datatype is varchar and string in field
like 'dd/mm/yy'. I want to convert varchar into
smalldatetime and output is 101 'mm/dd/yyyy'. my query is:
alter table name1 alter column date smalldatetime
error massage:Server: Msg 296, Level 16, State 3, Line 1
The conversion of char data type to smalldatetime data
type resulted in an out-of-range smalldatetime value.
The statement has been terminated.
then I try to convert.
alter table name1 add date1 smalldatetime
update name1
set date1=convert(varchar, date,101 )
error message:Server: Msg 296, Level 16, State 3, Line 1
The conversion of char data type to smalldatetime data
type resulted in an out-of-range smalldatetime value.
The statement has been terminated.
Thanks reply
- Previous message: anonymous_at_discussions.microsoft.com: "How to Convert Character String to Numeric- Thanks!"
- Next in thread: Vishal Parkar: "Re: how to convert varchar into smalldatatime"
- Reply: Vishal Parkar: "Re: how to convert varchar into smalldatatime"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|