B
Beemer Biker
I got my cross tab query to work by doing the following just before
executing select
AccessDataSourcet1.SelectCommand = sqlcmd + " WHERE " +
AccessDataSource1.FilterExpression.ToString();
AccessDataSource1.FilterExpression = "";
One would think the above should not have been necessary if the MS handler
for the FIlterExpression was the same MS code handler as the one that
handled the clause after the " WHERE ".
I assume the problem is related to the filter expression haveing "EmployeeID
IN (1,2,3 etc) " but I DID NOT have "EmployeeID" in the select items as I
didnt want it to show up in the data grid.
I found that if I added EmployeeID to the selected items, then my original
query worked fine as-is. The query had two inner joins and I assume that
something got broken when the handler processeS the FilterExpression
separate from the select statement.
According to http://tinyurl.com/b2bspt ms sql server cannot use a
parameterized comma delimited list. Is this also true for access? I was
tempted to use parameters in the above FilterExpression, but since I did get
it working using that " WHERE " I really dont want to change my code.
best regards
executing select
AccessDataSourcet1.SelectCommand = sqlcmd + " WHERE " +
AccessDataSource1.FilterExpression.ToString();
AccessDataSource1.FilterExpression = "";
One would think the above should not have been necessary if the MS handler
for the FIlterExpression was the same MS code handler as the one that
handled the clause after the " WHERE ".
I assume the problem is related to the filter expression haveing "EmployeeID
IN (1,2,3 etc) " but I DID NOT have "EmployeeID" in the select items as I
didnt want it to show up in the data grid.
I found that if I added EmployeeID to the selected items, then my original
query worked fine as-is. The query had two inner joins and I assume that
something got broken when the handler processeS the FilterExpression
separate from the select statement.
According to http://tinyurl.com/b2bspt ms sql server cannot use a
parameterized comma delimited list. Is this also true for access? I was
tempted to use parameters in the above FilterExpression, but since I did get
it working using that " WHERE " I really dont want to change my code.
best regards