Reputation: 1
I am Running in VBA But same is not working. Getting error no Value Given for one or more Required Parameter.
My Query :
esql = "Select MAPPING_MONTH.DT,SUM(MAIL_ACTIVE_Base_Tracker_GA_AM_AO.COUNT) as GA_COUNT From MAPPING_MONTH A LEFT OUTER JOIN MAIL_ACTIVE_Base_Tracker_GA_AM_AO B on A.DT=B.DATE where ((MAIL_ACTIVE_Base_Tracker_GA_AM_AO.CIRCLE)= " & """" & FName & "GROUP BY MAIL_ACTIVE_Base_Tracker_GA_AM_AO.CIRCLE"")"
RS.Open (esql), CN, adOpenStatic, adLockReadOnly
Upvotes: 0
Views: 291
Reputation: 9444
While there is some code missing which could be helpful in debugging the code here are some improvements which (potentially) already resolve your problem. If that's not the case then you might want to consider updating your post and include more of your code (where you declare RS
and CN
and setup the ADODB.Connection
).
Having said that here are the suggested changes:
esql = " select MAPPING_MONTH.DT, "
esql = esql & " sum(MAIL_ACTIVE_Base_Tracker_GA_AM_AO.COUNT) as GA_COUNT "
esql = esql & "from MAPPING_MONTH A "
esql = esql & "left outer join MAIL_ACTIVE_Base_Tracker_GA_AM_AO B "
esql = esql & "on A.DT = B.DATE "
esql = esql & "where MAIL_ACTIVE_Base_Tracker_GA_AM_AO.CIRCLE = N'" & FName & "' "
sql = esql & "group by MAIL_ACTIVE_Base_Tracker_GA_AM_AO.CIRCLE "
RS.Open esql, CN, adOpenStatic, adLockReadOnly
Changes:
esql
in the RS.Open
line."
inside your T-SQL for '
to include the file name as text.Upvotes: 0