Microsoft Query Error: Illegal Data: '{ts '2015-'. Expected Format: 'Default Datetime Mask'

I am creating an ODBC query in Excel 2003 (I know, old). When put in a parameter for a date, I get an error that says: Microsoft Query Error: Illegal Data: '{ts '2015-'. Expected Format: 'Default Datetime Mask' . When I look at the data without parameters, the date is in this format: YYYY-MM-DD. I have tried YYYY-MM-DD, YYYY-MM-DD HH:MM:SS and other variations of YYYY MM DD. Nothing is working. I get the same error every time. Any ideas?
brasimanAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ThomasMcA2Commented:
I think MS Query likes text dates surrounded by pound/hash signs: #2015-03-09#
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
chaauCommented:
when you use date literals in ODBC you need to use this syntax:
select * from Table1 where datecolumn > {d '2014-12-30'}      -- YYYY-MM-DD
select * from Table1 where datecolumn > {ts '2014-12-30 22:35:56'}      -- YYYY-MM-DD HH:MM:SS (HH should be in 24 hour format)

Open in new window

Please note that the {} should not be included into the apostrophes, only the date literal should. Here is the source from MSDN
0
Martin LissOlder than dirtCommented:
I've requested that this question be closed as follows:

Accepted answer: 250 points for ThomasMcA2's comment #a40655273
Assisted answer: 250 points for chaau's comment #a40655276

for the following reason:

This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.