SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Convert Char to date
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

chalamasql
Starting Member

India
4 Posts

Posted - 06/04/2013 :  09:03:13  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

Germany
8764 Posts

Posted - 06/04/2013 :  09:09:00  Show Profile  Visit webfred's Homepage  Reply with Quote
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

India
4 Posts

Posted - 06/04/2013 :  09:21:41  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

India
2206 Posts

Posted - 06/04/2013 :  09:32:24  Show Profile  Reply with Quote
--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

India
4 Posts

Posted - 06/04/2013 :  09:43:53  Show Profile  Reply with Quote
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

India
22754 Posts

Posted - 06/05/2013 :  03:45:46  Show Profile  Send madhivanan a Yahoo! Message  Reply with Quote
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

India
52317 Posts

Posted - 06/05/2013 :  03:50:35  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000