Hey guys,
I'm trying to query a specific date in Excel to pull data from Access. I have a date cell (the parameter) that will refresh the table based on user input [Date].
I get the following error "Microsoft ODBC Microsoft access driver data type mismatch in criteria expression." However, it works when [Date] is a text. I'd rather not convert date to string because it will mess everything else up and adds unnecessary complexity.
So here's the setup:
Access
Table "Bank"
Excel
Query from MS Access Database
The table is loaded into Excel. The results does show 1/6/2022. It is a date and not a text.
Parameters "Parameter1"
Get the value from the following cell: =Parameters!$A$2
Parameters!$A$2 is set to 1/6/2022 whose serial number is 44567 just to show you that it is indeed a date and not a text.
Error
"Microsoft ODBC Microsoft access driver data type mismatch in criteria expression"
Please advise on what needs to be done.
Thank you,
I'm trying to query a specific date in Excel to pull data from Access. I have a date cell (the parameter) that will refresh the table based on user input [Date].
I get the following error "Microsoft ODBC Microsoft access driver data type mismatch in criteria expression." However, it works when [Date] is a text. I'd rather not convert date to string because it will mess everything else up and adds unnecessary complexity.
So here's the setup:
Access
Table "Bank"
Field: "AS OF DATE"
Data Type: Date/Time
Query qryBank
SQL:
SELECT [AS OF DATE], AMOUNT, TEXT
FROM Bank
Excel
Query from MS Access Database
Load qryBank
Criteria Field: AS OF DATE
Value: [Parameter1]
To test it, I enter 1/6/2022 and result shows 2022-01-06 00:00:00 in the tableThe table is loaded into Excel. The results does show 1/6/2022. It is a date and not a text.
Parameters "Parameter1"
Get the value from the following cell: =Parameters!$A$2
Parameters!$A$2 is set to 1/6/2022 whose serial number is 44567 just to show you that it is indeed a date and not a text.
Error
"Microsoft ODBC Microsoft access driver data type mismatch in criteria expression"
Please advise on what needs to be done.
Thank you,