0

I'm trying to run a SQL-query in Excel 2010 to MS SQL-Server 2008 with one parameter in DATETIME format:

SELECT * FROM mytable WHERE myCreateDate > ?

The column myCreateDate is DATETIME in MS SQL-Server. The parameter comes from a cell in Excel.

What do I have to enter in the Excel-cell? If I create the query in msquery directly, it writes

myCreateDate > {ts '2013-03-19 10:01:36'}

and it works. But I cannot get it work with a parameter.

Thanks for help.

Ralf Hundewadt
  • 1,078
  • 1
  • 13
  • 25

1 Answers1

0

To change the parameter just edit the query in Data>connections>. Change the date time to ? When you close you will be prompted to go pick an excel cell. Just enter the date in the cell in any format and it should work.

Bri
  • 1