G
Guest
Hi Guys,
I am programatically creating a query and the exclusion part ("NOT") of my
WHERE clause is not being added to the query. Is this a glitch? Can it not
be done? Any Ideas?
string: (look for "NOT")
strSQL = strSQL & "WHERE (Fund=[forms]![frmFund].[txtFundName] AND "
strSQL = strSQL & "Report_Year=[Forms]![frmFund]![cboYear] And "
strSQL = strSQL & "Report_Month=[forms]![frmFund]![cboMonth]) "
strSQL = strSQL & "AND NOT (Share_Class is null AND"
strSQL = strSQL & "(Fund_Name = " & """PUTNAM STABLE VALUE FUND""" & " ) "
strSQL = strSQL & "GROUP BY.......
Query created:
SELECT DISTINCTROW tblFund.Acct_Num.....
FROM tblFund
WHERE (((tblFund.Fund)=[forms]![frmFund].[txtFundName])
AND ((tblFund.Report_Year)=[Forms]![frmFund]![cboYear])
AND ((tblFund.Report_Month)=[forms]![frmFund]![cboMonth])
AND (([Share_Class] Is Null And ([Fund_Name]="PUTNAM STABLE VALUE FUND" Or
[Fund_Name]="PUTNAM INDEX"))=False))
GROUP BY ..........
I am programatically creating a query and the exclusion part ("NOT") of my
WHERE clause is not being added to the query. Is this a glitch? Can it not
be done? Any Ideas?
string: (look for "NOT")
strSQL = strSQL & "WHERE (Fund=[forms]![frmFund].[txtFundName] AND "
strSQL = strSQL & "Report_Year=[Forms]![frmFund]![cboYear] And "
strSQL = strSQL & "Report_Month=[forms]![frmFund]![cboMonth]) "
strSQL = strSQL & "AND NOT (Share_Class is null AND"
strSQL = strSQL & "(Fund_Name = " & """PUTNAM STABLE VALUE FUND""" & " ) "
strSQL = strSQL & "GROUP BY.......
Query created:
SELECT DISTINCTROW tblFund.Acct_Num.....
FROM tblFund
WHERE (((tblFund.Fund)=[forms]![frmFund].[txtFundName])
AND ((tblFund.Report_Year)=[Forms]![frmFund]![cboYear])
AND ((tblFund.Report_Month)=[forms]![frmFund]![cboMonth])
AND (([Share_Class] Is Null And ([Fund_Name]="PUTNAM STABLE VALUE FUND" Or
[Fund_Name]="PUTNAM INDEX"))=False))
GROUP BY ..........