Avatar of ukerandi
ukerandi
Flag for United Kingdom of Great Britain and Northern Ireland asked on

t-sql Export to Excel

in the sql results is showing customer number is 01NOV02,02NOV02..etc, after export to the Microsoft Excel sheet ,its showing the 01-Nov-02.
I try usig Convert (varchar(50,[Customer Number])) but after export to the excel its showing date format (01-Nov-02.
) how to export to the Excel with out changing to the dae format?

Many thanks
Microsoft ExcelMicrosoft SQL Server 2008VBASQL

Avatar of undefined
Last Comment
Ryan Chong

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Jim Horn

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Ray

You can export to a csv or txt file then open excel (not the file itself, just Excel), then use the Excel "File" menu to "open" the file, but BEFORE opening use the options at the bottom of the window to "import" the file.  Ensure you set that column as TEXT before allowing it to import.
SOLUTION
Peter Chan

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Ryan Chong

>>how to export to the Excel with out changing to the dae format?
when you try to import them, set the column data format as Text

column data format to Text
Ryan Chong

sorry, disregard comment ID: 40962103 as didn't see Ray already posted same suggestion.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck