Microsoft SQL Server
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft SQL Server

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old June 16th, 2004, 04:28 AM
JohannL JohannL is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Location: United Arab Emirates
Posts: 7 JohannL User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy Importing a 24hr time format from excel to a table in sql 2000.

I am having an issue trying to import data from two columns in an excel sheet into a table in SQL 2000.

The two columns are in a format that I dont want changed when it is imported.

Column 2 is the time of which a call was made. I would like it to display in the 24 hour format because Crystal Reports makes a mess of the 12hour clock entries and the reports are then wrong. the current format in the excel sheet is HH:MM:SS (eg. 14:34:02).

Colmn 6 is the time that the call took which is also displayed in the same format as column 2. (please see zip file attachment if it uploaded)

How do i go about importing these two fields without the format changing?
Basically when I try to import the data, I get an error message after it runs. The changed the default data type from 'smalldatetime' to text and to nvarchar but nothing worked. In fact the dat ended up being distorted.
Any help regarding this issue would be most appreciated.
regards
JohannL
Attached Files
File Type: zip data.zip (8.5 KB, 357 views)

Reply With Quote
  #2  
Old June 16th, 2004, 10:10 AM
Memnoch's Avatar
Memnoch Memnoch is offline
Unholy Moderator
ASP Free God 14th Plane (11500 - 11999 posts)
 
Join Date: Oct 2003
Location: In hell, where did you think?
Posts: 11,770 Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level) 
Time spent in forums: 3 Weeks 5 Days 6 h 58 m 22 sec
Reputation Power: 469
You can try these formats
Code:
PRINT '2) HERE IS MM-DD-YY FORMAT ==>' + 
CONVERT(CHAR(8),GETDATE(),14) 

PRINT '2) HERE IS MM-DD-YY FORMAT ==>' + 
CONVERT(CHAR(20),GETDATE(),13) 

Reply With Quote
  #3  
Old June 20th, 2004, 01:14 AM
JohannL JohannL is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Location: United Arab Emirates
Posts: 7 JohannL User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Talking Importing a 24hr time format from excel to a table in sql 2000.

Great Thanks Memnoch. i'll give this a go and let you know how i got on.

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft SQL Server > Importing a 24hr time format from excel to a table in sql 2000.


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT