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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Export from SQL 2000 to CSV File

Status
Not open for further replies.

qberta01

Programmer
Nov 14, 2005
113
Hello,

I have created a DTS package that exports to a csv file. However, most people will open this report in Excel. When opened in Excel one of the fields shows as exponential when it should show as text only. For example, 2.00706E+13 should be 20070614145900. Unfortuantely, I cannot just export as Excel because it's some kind of security threat.

Any ideas?

Thx,

Q
 
Try surrounding the values with double quotes.

Denny
MCSA (2003) / MCDBA (SQL 2000)
MCTS (SQL 2005 / Microsoft Windows SharePoint Services 3.0: Configuration / Microsoft Office SharePoint Server 2007: Configuration)
MCITP Database Administrator (SQL 2005) / Database Developer (SQL 2005)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
Looks like a date / time field that you are having a problem with. you could try converting it.Some of the kind people helped me with the time bit so I elaborated to get date time from a char 15 field - replace MYFIELD as needed.

Code:
select convert (datetime,(Stuff(Stuff(Stuff(Stuff(Stuff(Stuff(MYFIELD, 5, 0, '-'), 8,0,'-'), 11,0, ' '), 14,0,':'), 17, 0, ':'), 20, 0, '.')))

HTH,

M.
 
Sorry - my bad.

the 1st morning coffee should be finished before reading in detail. The conversion I posted is expecting 1 more character.
 
Thanks people! I resorted to putting a period before and after the field. However, I will try the suggestions and see how it works!

Thx,

Q
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top