I have found several threads with this exact title. However, they are for different databases than what I am using.
I am using MS-Query in Office 365 (I assume enterprise edition - it's on my work system)
I use, as my data source ,the MS-Excel driver that comes with Excel. I can query any Excel file with this driver. The problem comes when I try to prompt for a date. I use the eyeglass and funnel icon, select the date field and type in Between [a] and [b]. I checked the SQL code produced by the wizard and it looks correct.
When I click on the Exit Door icon to return the data, I get the prompts and fill them in with valid date formats E.g. 4/25/2022. After filling in the second date, I get the error. I tried different incantations for the date 15 Apr 2022, 15-Apr-2022, 20220415, etc. and get syntax errors when I do that.
If I can escape this trap and click on the returned data table and select Parameters, I can read the two dates from cells in the spreadsheets.
All of the other responses to this question recommend recasting the data type. Is this even possible in MS-Query?
This problem is fairly recent. I can't recall the last time I prior when I tried to prompt for a date this way and did not get the error, but it's been with me for the past 4 weeks.
My apology for the tags - I could not find a valid tag for this issue,.