How JustAnswer Works:
  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site. Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.
Ask Richard Your Own Question
Richard, Software Specialist
Category: Microsoft Office
Satisfied Customers: 37648
Experience:  Over 15 year experience resolving Microsoft Office Issues
Type Your Microsoft Office Question Here...
Richard is online now
A new question is answered every 9 seconds

I need export data from sql to excel file should be in

Customer Question

I need export data from sql to excel file should be in format mmddyyyy
Submitted: 2 years ago.
Category: Microsoft Office
Expert:  Richard replied 2 years ago.

Can you tell me which SQL this is please?


Expert:  Richard replied 2 years ago.

I saw on your duplicate it was SQL 2008

To do this, you use a query

insert into OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=C:\testing.xls;', 'SELECT CONVERT(VARCHAR(10), fmdate(), 101) FROM [SheetName$]') select * from SQLServerTable

Replace Sheetname with the sheet name in the existing excel file.

This will then select the Date and put it in mmddyyy you just need to replace the fmdate with the field i your table and the SQLServer Table with the table itself

If you have continued problems, or would like any additional information or assistance, please do not hesitate to let me know.

Else if you can take a second to rate my service by clicking one of the stars at the top of the screen then submit, that would be greatly appreciated.

Thank you