dbTalk Databases Forums  

Missing: hour/minute / second data (smalldatetime)

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Missing: hour/minute / second data (smalldatetime) in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Justin Doh
 
Posts: n/a

Default Missing: hour/minute / second data (smalldatetime) - 10-06-2005 , 12:37 PM






I am bringing in AS400 data into SQL.
I found some data missing " hour:minute:second (AM or PM) " information.
This data field is "smalldatetime."

For example,
10/3/2005 12:00:00 PM
10/3/2005 12:00:00 PM
10/3/2005 12:00:00 PM
10/3/2005
10/3/2005 12:00:00 PM
10/3/2005 12:00:00 PM

Any idea to resolve this issue?

Appreciate.



Reply With Quote
  #2  
Old   
Thomas Bradshaw via SQLMonster.com
 
Posts: n/a

Default Re: Missing: hour/minute / second data (smalldatetime) - 10-06-2005 , 01:24 PM






Justin,

A couple questions:

1) What does the source time say? Any way of examining those fields to see
why they behave as they do?

2) How are you viewing the column? I get your described behavior when
opening the table in Enterprise Manager. The date/time rows with the time
missing are the ones that start at midnight.

Try viewing the table in Query Analyzer to see if they are truly missing.
Let us know how you make out.

Thomas Bradshaw
Data Integration Specialist
MyWebGrocer.com


--
Message posted via http://www.sqlmonster.com

Reply With Quote
  #3  
Old   
Justin Doh
 
Posts: n/a

Default Re: Missing: hour/minute / second data (smalldatetime) - 10-06-2005 , 01:38 PM



Thank you Thomas.

I was able to find the difference with Query Analyzer, and it looked as

2005-10-03 00:00:00.

I think that is good catch and my learning experience.

Question: Why then this does not appear as

" 10/3/2005 12:00:00 AM " instead?



"Thomas Bradshaw via SQLMonster.com" wrote:

Quote:
Justin,

A couple questions:

1) What does the source time say? Any way of examining those fields to see
why they behave as they do?

2) How are you viewing the column? I get your described behavior when
opening the table in Enterprise Manager. The date/time rows with the time
missing are the ones that start at midnight.

Try viewing the table in Query Analyzer to see if they are truly missing.
Let us know how you make out.

Thomas Bradshaw
Data Integration Specialist
MyWebGrocer.com


--
Message posted via http://www.sqlmonster.com


Reply With Quote
  #4  
Old   
Andrew J. Kelly
 
Posts: n/a

Default Re: Missing: hour/minute / second data (smalldatetime) - 10-06-2005 , 03:04 PM



The way it is displayed depends on the gui that is displaying it unless you
have formatted it into a string with CONVERT().

--
Andrew J. Kelly SQL MVP


"Justin Doh" <JustinDoh (AT) discussions (DOT) microsoft.com> wrote

Quote:
Thank you Thomas.

I was able to find the difference with Query Analyzer, and it looked as

2005-10-03 00:00:00.

I think that is good catch and my learning experience.

Question: Why then this does not appear as

" 10/3/2005 12:00:00 AM " instead?



"Thomas Bradshaw via SQLMonster.com" wrote:

Justin,

A couple questions:

1) What does the source time say? Any way of examining those fields to
see
why they behave as they do?

2) How are you viewing the column? I get your described behavior when
opening the table in Enterprise Manager. The date/time rows with the
time
missing are the ones that start at midnight.

Try viewing the table in Query Analyzer to see if they are truly missing.
Let us know how you make out.

Thomas Bradshaw
Data Integration Specialist
MyWebGrocer.com


--
Message posted via http://www.sqlmonster.com




Reply With Quote
  #5  
Old   
Beau Frusetta
 
Posts: n/a

Default Re: Missing: hour/minute / second data (smalldatetime) - 10-18-2005 , 04:12 PM



The smalldatetime data type does not store h/m/s data as a datetime data type
would on SQL Server.

In your destination table make the field a "datetime" data type instead of
"smalldatetime".

Beau

"Andrew J. Kelly" wrote:

Quote:
The way it is displayed depends on the gui that is displaying it unless you
have formatted it into a string with CONVERT().

--
Andrew J. Kelly SQL MVP


"Justin Doh" <JustinDoh (AT) discussions (DOT) microsoft.com> wrote in message
news7448E86-7DF3-4D41-BC78-C9FF03B7CCF1 (AT) microsoft (DOT) com...
Thank you Thomas.

I was able to find the difference with Query Analyzer, and it looked as

2005-10-03 00:00:00.

I think that is good catch and my learning experience.

Question: Why then this does not appear as

" 10/3/2005 12:00:00 AM " instead?



"Thomas Bradshaw via SQLMonster.com" wrote:

Justin,

A couple questions:

1) What does the source time say? Any way of examining those fields to
see
why they behave as they do?

2) How are you viewing the column? I get your described behavior when
opening the table in Enterprise Manager. The date/time rows with the
time
missing are the ones that start at midnight.

Try viewing the table in Query Analyzer to see if they are truly missing.
Let us know how you make out.

Thomas Bradshaw
Data Integration Specialist
MyWebGrocer.com


--
Message posted via http://www.sqlmonster.com





Reply With Quote
  #6  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Missing: hour/minute / second data (smalldatetime) - 10-18-2005 , 04:23 PM



Hello Beau Frusetta" bizzeau at hotmail dot com,

Smalldatetime will happily display the hour and minutes. It does not display
seconds.

Allan



Quote:
The smalldatetime data type does not store h/m/s data as a datetime
data type would on SQL Server.

In your destination table make the field a "datetime" data type
instead of "smalldatetime".

Beau

"Andrew J. Kelly" wrote:

The way it is displayed depends on the gui that is displaying it
unless you have formatted it into a string with CONVERT().

-- Andrew J. Kelly SQL MVP

"Justin Doh" <JustinDoh (AT) discussions (DOT) microsoft.com> wrote in message
news7448E86-7DF3-4D41-BC78-C9FF03B7CCF1 (AT) microsoft (DOT) com...

Thank you Thomas.

I was able to find the difference with Query Analyzer, and it looked
as

2005-10-03 00:00:00.

I think that is good catch and my learning experience.

Question: Why then this does not appear as

" 10/3/2005 12:00:00 AM " instead?

"Thomas Bradshaw via SQLMonster.com" wrote:

Justin,

A couple questions:

1) What does the source time say? Any way of examining those
fields to
see
why they behave as they do?
2) How are you viewing the column? I get your described behavior
when
opening the table in Enterprise Manager. The date/time rows with
the
time
missing are the ones that start at midnight.
Try viewing the table in Query Analyzer to see if they are truly
missing. Let us know how you make out.

Thomas Bradshaw
Data Integration Specialist
MyWebGrocer.com
-- Message posted via http://www.sqlmonster.com




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.