Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Keeping the TIME in a DATE/TIME result from DTS???

Status
Not open for further replies.

hneal98

Programmer
Aug 13, 2002
1,637
US
Can anyone tell me how I can make sure my result shows both Date and Time when the source is a smalldatetime field? The results are truncated and only the date is showing.

Any help is greatly appreciated.

Thanks.
 
How are you displaying the smalldatetime field? A query in Query Analyzer, a web page etc.?

Datetime columns are stored in SQL Server as the number of seconds since a certain date. To format the display of datetime columns, use the CONVERT function with the style parameter to format the result as character data, e.g.

SELECT Convert(varchar(20), MyDateTimeColumn, 103)

to display the date in British dd/mm/yy format,

SELECT Convert(varchar(20), MyDateTimeColumn)

to display the default format, mon dd yyyy hh:miAM/PM

and so on.

Hope that helps,




Nathan
[yinyang]
----------------------------------------
Want to get a good response to your question? Read this FAQ! -> faq183-874
----------------------------------------
 
Thanks for your response. I found that I needed to set up the transformation step so it used the Copy Column instead of using VB Script. It seems to work now.

Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top