Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Convert Char to date

Author  Topic 

chalamasql
Starting Member

4 Posts

Posted - 2013-06-04 : 09:03:13
I have CLOSED DATE OBJECT ITS CONTAIND DATA LIKE DD/MM/YYYY HH:MM:SS FORMAT(vARCHAR)

BUT I WANT DD/MM/YYYY IN DATE FORMAT

HOW TO CONVERT FROM VACHAR TO DATE FORMAT(DD/MM/YYYY)

PLEASE HELP ME


chalama reddy

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2013-06-04 : 09:09:00
What's the matter with your keyboard? CapsLock damaged?

There is no datatype DATE in SQL Server 2000.
Can you make more clear what you are trying to do?


Too old to Rock'n'Roll too young to die.
Go to Top of Page

chalamasql
Starting Member

4 Posts

Posted - 2013-06-04 : 09:21:41
Hi,

we have a date column "ReviewDate" in the database. the values in the column is loaded in the format of "dd/mm/yy hh:mm:ss" as
character data type.But I need "dd/mm/yy hh:mm:ss" in datetime format



chalama reddy
Go to Top of Page

bandi
Master Smack Fu Yak Hacker

2242 Posts

Posted - 2013-06-04 : 09:32:24
--Method1:
Alter that table column (ReviewDate) to DATETIME

--Method2:
DECLARE @CharVar VARCHAR(40) = '04/06/13 18:58:30'
SELECT CAST( @CharVar AS DATETIME) -- 2013-04-06 18:58:30.000

--
Chandu
Go to Top of Page

chalamasql
Starting Member

4 Posts

Posted - 2013-06-04 : 09:43:53
I created like this way
Convert(DateTime,dbo.STAR_INP_GIT_STATUS_REP."Last Edited on",103)--- am getting output--2013-05-22 08:21:00.000

But I need "dd/mm/yy hh:mm:ss"

chalama reddy
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2013-06-05 : 03:45:46
quote:
Originally posted by chalamasql

I created like this way
Convert(DateTime,dbo.STAR_INP_GIT_STATUS_REP."Last Edited on",103)--- am getting output--2013-05-22 08:21:00.000

But I need "dd/mm/yy hh:mm:ss"

chalama reddy


Do not worry about how SQL Server displays the dates. When you show them to front end application, format them there

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-06-05 : 03:50:35
Continued here

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=185834

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
   

- Advertisement -