If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Datetime value when fractional (hours etc) part is zero

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-03-07, 09:44
Coolberg Coolberg is offline
Registered User
 
Join Date: Jul 2002
Posts: 229
Time part stripped from datetime data when zero

It seems like when selecting a Datetime field through ADO, I'm getting for instance "2007-01-03 14:20:15.123" if the time part is not zero, but just
"2007-01-03" if the time part is "00.00.00.000" .
This is perfectly ok in my case (I'm just storing the date part
when INSERT:ing) - my only concern is; can I always rely upon this?
Reply With Quote
  #2 (permalink)  
Old 01-03-07, 11:29
blindman blindman is offline
World Class Flame Warrior
 
Join Date: Jun 2003
Location: Ohio
Posts: 11,726
You get different formats in ADO from the same column, depending upon the data?

That seems odd to me, but if so then it is an ADO issue and has nothing to do with SQL Server (as long as your dates are actually stored as datetime types and not strings...).
__________________
If it's not practically useful, then it's practically useless.

blindman
www.chess.com: "sqlblindman"
Reply With Quote
  #3 (permalink)  
Old 01-03-07, 14:11
Coolberg Coolberg is offline
Registered User
 
Join Date: Jul 2002
Posts: 229
Yes, in a way - depending on whether the time part (also called the fractional part?) is zero or not.

Could you recommend any good forum for ADO issues?
Reply With Quote
  #4 (permalink)  
Old 01-03-07, 15:27
blindman blindman is offline
World Class Flame Warrior
 
Join Date: Jun 2003
Location: Ohio
Posts: 11,726
__________________
If it's not practically useful, then it's practically useless.

blindman
www.chess.com: "sqlblindman"
Reply With Quote
  #5 (permalink)  
Old 01-04-07, 11:58
Coolberg Coolberg is offline
Registered User
 
Join Date: Jul 2002
Posts: 229
Datetime value when fractional (hours etc) part is zero

It seems like when selecting a Datetime field through ADO, I'm getting for instance "2007-01-03 14:20:15.123" if the time part is not zero, but just
"2007-01-03" if the time part is "00.00.00.000" .
This is perfectly ok in my case (I'm just storing the date
part when INSERT:ing) - my only concern is; can I always rely upon this?
Reply With Quote
  #6 (permalink)  
Old 01-04-07, 11:58
Coolberg Coolberg is offline
Registered User
 
Join Date: Jul 2002
Posts: 229
Thanks, Blindman. I'll try that board.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On