ch460960
(Ch460960)
March 1, 2024, 6:26am
1
Hi all,
I’m trying to dynamically assign values while using excel as DB
Error: Run query: ERROR [07002] [Microsoft][ODBC Excel Driver] Too few parameters. Expected 2.
Command I’m Giving
"SELECT SUM(PEJAMT) AS SUMTOTAL FROM [Query$A6:Z] WHERE [PEACCM] = @PEACCM AND [PEACCD] = @PEACCD "
Thanks
ch460960
(Ch460960)
March 1, 2024, 6:32am
3
It’s clear in that thread, he is not able to pass parameter either rather he passing value directly.
lrtetala
(Lakshman Reddy)
March 1, 2024, 6:36am
4
Hi @ch460960
Try this
"SELECT SUM(PEJAMT) AS SUMTOTAL FROM [Query$A6:Z] WHERE [PEACCM] = '" & yourPEACCMValue & "' AND [PEACCD] = '" & yourPEACCDValue & "'"
ch460960
(Ch460960)
March 1, 2024, 6:43am
5
Hi @lrtetala ,
Thanks it works… mention in that Thread what @Krishna_Raj posted earlier. Is there any way I can pass parameter? What is the use of parameter property then?
Thanks