Hello,
i have created a sql query using "new database query" in excel. i need to use that query in a macro and use variables in the query.
the bold text needs to be substituted with variable which i get as user input.
for example fd00000001 needs to be fund_name and 2007-11-30 00:00:00.000 needs to cutoff and 0.5 needs to be unit_filter. these three variable will get data from another sheet based on list selection by the user.
.CommandText = Array("SELECT FPREDEAL.HOLDER, DNUCLEUS.REFERENCE , SUM(FPREDEAL.HOLDING) , FPREDEAL.FUND FROM FPREDEAL INNER JOIN DNUCLEUS ON FPREDEAL.HOLDER = DNUCLEUS.CODE WHERE (", "FPREDEAL.FUND = 'fd00000001') AND (FPREDEAL.DEALT = 'Y') AND (FPREDEAL.SETTLED = 'Y') AND (FPREDEAL.REVERSED <> 'Y' OR FPREDEAL.REVERSED IS NULL) AND (FPREDEAL.DEALING_DATE <= '", "2007-11-30 00:00:00.000') GROUP BY DNUCLEUS.REFERENCE, FPREDEAL.HOLDER, FPREDEAL.FUND having (sum(fpredeal.holding)>=0.5)")
Configuration: Windows XP Firefox 3.0.5
Hi,
|