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
 General SQL Server Forums
 New to SQL Server Programming
 Returning Date to DateTime?

Author  Topic 

Informer30
Starting Member

26 Posts

Posted - 2011-06-21 : 09:21:09
Hi All,

please can advise what the following code will do?

cast(convert(varchar,#,112)as datetime)

Will it return the result as date or datetime?

Many Thanks

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2011-06-21 : 09:24:38
DATETIME data type. If you want DATE data type do: cast(convert(varchar,#,112)as DATE); DATE data type is available only on SQL 2008 or higher.
Go to Top of Page

Informer30
Starting Member

26 Posts

Posted - 2011-06-21 : 09:28:34
Thanks Sunita....
ps. lovely name
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2011-06-21 : 09:47:30
quote:
Originally posted by Informer30

Thanks Sunita....
ps. lovely name


Hey - that's my part


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2011-06-21 : 10:06:34
quote:

Hey - that's my part


Okay, okay, Fred! "Fred" is a lovely name too!!
Go to Top of Page

Informer30
Starting Member

26 Posts

Posted - 2011-06-21 : 10:18:52
Sunita, what about me....

Go to Top of Page

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2011-06-21 : 10:25:38
Oh! I thought that was obvious without even saying!! There is NO name more beautiful than "Informer"!!!
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2011-06-21 : 10:32:22
quote:
Originally posted by sunitabeck

Oh! I thought that was obvious without even saying!! There is NO name more beautiful than "Informer"!!!


I do not agree. There is ONE name more beautiful than "Informer":
Sunita


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

Informer30
Starting Member

26 Posts

Posted - 2011-06-21 : 10:44:07
I must agree with you Fred in my English accent!

Sunita is such a beautiful name....
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2011-06-29 : 04:30:01
Sunita, you have lot of fans here

Madhivanan

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

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2011-06-29 : 06:53:40
Madhivanan, I wish! They are just fans of my NAME!!
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2011-06-29 : 07:11:26
But I am also a fan of your very good posts!


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2011-06-29 : 07:32:09
quote:
Originally posted by webfred

But I am also a fan of your very good posts!


No, you're never too old to Yak'n'Roll if you're too young to die.


Fred! If there is no hint of teasing in there, then you are going to make my head explode with pride!!

In either case, "back at ya!!"
Go to Top of Page
   

- Advertisement -