Welcome to dbForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

SmallDatetime Conversion?

 
   Database Forums (Home) -> MSEQ RSS
Next:  storing documents  
Author Message
Ryan Mcbee

External


Since: May 17, 2007
Posts: 9



(Msg. 1) Posted: Mon Sep 24, 2007 8:28 am
Post subject: SmallDatetime Conversion?
Archived from groups: microsoft>public>sqlserver>mseq (more info?)

I do I convert a field that is "smalldatetime" to "datetime"?

I am doing a select statement from a table and need my output to be
"datetime".

Thanks,
Raj

 >> Stay informed about: SmallDatetime Conversion? 
Back to top
Login to vote
Hugo Kornelis

External


Since: Jan 31, 2006
Posts: 335



(Msg. 2) Posted: Mon Sep 24, 2007 7:29 pm
Post subject: Re: SmallDatetime Conversion? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Mon, 24 Sep 2007 08:28:06 -0700, Ryan Mcbee wrote:

>I do I convert a field that is "smalldatetime" to "datetime"?
>
>I am doing a select statement from a table and need my output to be
>"datetime".

Hi Raj,

You can simply use

CAST (ColumnName AS datetime)

--
Hugo Kornelis, SQL Server MVP
My SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis

 >> Stay informed about: SmallDatetime Conversion? 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
EXEC (select... ) problem Help! - How can I get this to work? declare @WkEmpID declare @sql varchar(1000) set @sql = 'select distinct @WkEmpID = EmpID from Employee' exec (@sql) Now this is a simplified version of a more comples query which is forcing me to use this method rather than...

Query returning multiple rows - Hi, I have a query that returns back rows that have multiple entries for a given UniqueID. I want the query to be expanded so that it then only returns 1 of the multiple rows based on the maximum date. Thefore, my return set looks like this: ..

Having a stored procedure copy tables & also preserve inde.. - Hello, I created a stored procedure that renames a table to OLD_xxxxx and replaces that table with another (copy) that resides on a different database. I pull the tablename names through the use of a cursor table and construct a SELECT INTO statement a...

GROUP BY's on 3 tables in one SELECT? - Hi there, I'd like to ask you for help with following: having 3 tables: T1 (Person_ID, Product_ID, Costs) T2 (Person_ID, Product_ID, Balancies) T3 (Product_ID, Product_Type) I have simple GROUP BY query: SELECT T1.Person_ID, T1.Product_ID, MAX(Costs)..

Query needs to loop? - Is this possible? A char variable length field contains this data: (for example) ABC,XYZ,GEF,CAB I need to query another table on the contents of each of these names that are separated by comma. I need to read ABC and then query another table for ABC in...
   Database Forums (Home) -> MSEQ All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]