Hi
I am having a problem to convert the date format
This is my date feild in an existing database
6/26/02 11
05/02/2002
6/05/02 3:
6/12/02 11
05/02/2002
05/02/2002
6/06/02 10
6/06/02 10
6/06/02 10
6/06/02 10
6/06/02 10
6/06/02 10
05/02/2002
I want date in format of mm/dd/yyyy or mm/dd/yyyy hh:mm:ssss (Time doesn't matter, 12:00:AM is good )
I was trying
CONVERT(datetim e,LEFT(dbo.Orde r_Lines.BIN, CHARINDEX(' ', dbo.Order_Lines .BIN, 0)))
tablename :order_lines
filedname: bin
It works for 90% records(like 6/06/02 10). But for some records it gives no date it gives 12:00:AM only, i think when CHARINDEX(' ', dbo.Order_Lines .BIN, 0 )returns a negative value or 0.
Not sure
Thanks in advance
I am having a problem to convert the date format
This is my date feild in an existing database
6/26/02 11
05/02/2002
6/05/02 3:
6/12/02 11
05/02/2002
05/02/2002
6/06/02 10
6/06/02 10
6/06/02 10
6/06/02 10
6/06/02 10
6/06/02 10
05/02/2002
I want date in format of mm/dd/yyyy or mm/dd/yyyy hh:mm:ssss (Time doesn't matter, 12:00:AM is good )
I was trying
CONVERT(datetim e,LEFT(dbo.Orde r_Lines.BIN, CHARINDEX(' ', dbo.Order_Lines .BIN, 0)))
tablename :order_lines
filedname: bin
It works for 90% records(like 6/06/02 10). But for some records it gives no date it gives 12:00:AM only, i think when CHARINDEX(' ', dbo.Order_Lines .BIN, 0 )returns a negative value or 0.
Not sure
Thanks in advance
Comment