Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I've already asked the question at: StackOverFlow and got sent to this place here.

I'm importing dates from a German SQL Server table into a German Excel file via the built-in Excel connection tool.

However the date format is just like in the SQL Server: 2012-08-08 but I want to display: 08.08.2012. When I double-click inside a cell it will recognize the German date formatting but of course I would like to have that format for the entire column in the beginning without having to manually change it.

I also need to be able to use these dates for calculations.

I know there is a text box where you can enter a SQL "Definition" in the Excel Connection tool but it doesn't really work with "normal" SQL-statements.

Do I need to change something in SQL Server or how do I make this work?

Thank you.

share|improve this question
As a standard practice it is ussually easier/faster to change how something is being done in the database rather than trying to mess around with it after it has been extracted. I would try to research changing how the date is stored in SQL Server, which shouldn't be that hard to do. Also, welcome to SuperUser! – Salmonerd Aug 8 '12 at 12:41
I've already tried my luck there. When I set-up a test table and insert values like this: insert into [dbo].[DateTest] Values ('2011-12-01', '01.12.2011'). The output is always the first format. With DBCC USEROPTIONS I can see the dateformat is set to dmy. What do I need to modify? A little example would be really nice. Thank you. – TonyC Aug 8 '12 at 13:16
For future reference, please don't cross-post. You should instead flag your question for migration. – Iszi Aug 8 '12 at 13:56
apparently SQL server has built in styles for this. Here is how to select a date and convert it to german. SELECT CONVERT(varchar, getdate(), 4) – Salmonerd Aug 8 '12 at 14:22
and where exactly do I use this statement in the excel connection tool? If yes, what is the right syntax for it? – TonyC Aug 9 '12 at 4:45

1 Answer 1

If I understand you correctly, you're saying the field in SQL Server is stored in datetime format, and you want to pull that info into Excel by creating a connection to your SQL Server table, and display it in German date form

You shouldn't need to edit the SQL in the definition tab of the Connection Properties window for formatting purposes - this may be simpler than you think.

  1. Use Excel's Data Connection Wizard to pull in the table you want to show in Excel.

  2. Then in Excel, for each date column, select the entire column, click format cells (or the handy keyboard shortcut is Ctrl+1), then on the Number tab click Custom at the bottom of the column on the left. In the "Type" text box, enter:

  3. The next time you refresh the data, Excel should retain the German formatting of your dates. You can use anything in these columns for calculations, Excel knows they are dates.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.