Hello
I've got a query, it pulls sales data according to "cluster". Cluster can be A, B, C, D, or empty.
I want this query to be able to pull 2 values by being run 2 times:
- Sales of one cluster (empty ones are treated as one cluster).
- Sales of everything.
To do so, I use in my VBA module the QueryDef object and pass my parameters to them:
It works with a cluster being A, B, C and so on. It works with the cluster being "*". However it does not work with cluster being null, vbNullString or "".
I can't use an "OR IS NULL" in the query because then I'd have those nulls being added to all my values.
How am I supposed to get the sales of my empty cluster?
Thank you
I've got a query, it pulls sales data according to "cluster". Cluster can be A, B, C, D, or empty.
I want this query to be able to pull 2 values by being run 2 times:
- Sales of one cluster (empty ones are treated as one cluster).
- Sales of everything.
To do so, I use in my VBA module the QueryDef object and pass my parameters to them:
Code:
qd.Parameters![p_param1] = stuff
qd.Parameters![p_param2] = stuff2
qd.Parameters![p_cluster] = cluster
It works with a cluster being A, B, C and so on. It works with the cluster being "*". However it does not work with cluster being null, vbNullString or "".
I can't use an "OR IS NULL" in the query because then I'd have those nulls being added to all my values.
How am I supposed to get the sales of my empty cluster?
Thank you