K
krexroth
I have 2 queries looking at a sql dbase to gather commission data. I have
the classic situation of always having Salesperson1, but occasionally having
salesperson2 in a split. The first query gathers all invocing records based
on the date. The second query is basically the same, except it currently has
the "<>isnull" criteria set to focus on only valid salesperson2 records.
Now I want to give our controller a simple form collecting the 3 values ;
salesID, beginning invoice date and ending invoice date. I want the enduser
to be able to either enter a single sales code along with the dates, or to
leave the salesid field blank (or enter a wildcard value) to have the queries
cast their "widest net"...in other words, act as they are setup by default
with qry1 getting all Sales1 adn qry2 getting all records where
salesid<>isnull.
For qry1 i've tried this criteria syntax:
IIf(IsNull([Forms]![formListParams]![SalesID]),Not
([dbP_SLSAHEAD].[Salesperson_Id_1])="isnull",([Forms]![formListParams]![SalesID]))...so
when the form field is null, look at all non-null sales1 records in the
table, else use the form.
For qry2, I've tried similar syntax to test for a null form!salesID field
and if true, then get any non-null sales2id record from the table, else use
the form. I am either using an incorrect implementation of logic or syntax.
Can someone propose a good solution. Seems simple, but I've been staring too
long! Thanks, Dave
the classic situation of always having Salesperson1, but occasionally having
salesperson2 in a split. The first query gathers all invocing records based
on the date. The second query is basically the same, except it currently has
the "<>isnull" criteria set to focus on only valid salesperson2 records.
Now I want to give our controller a simple form collecting the 3 values ;
salesID, beginning invoice date and ending invoice date. I want the enduser
to be able to either enter a single sales code along with the dates, or to
leave the salesid field blank (or enter a wildcard value) to have the queries
cast their "widest net"...in other words, act as they are setup by default
with qry1 getting all Sales1 adn qry2 getting all records where
salesid<>isnull.
For qry1 i've tried this criteria syntax:
IIf(IsNull([Forms]![formListParams]![SalesID]),Not
([dbP_SLSAHEAD].[Salesperson_Id_1])="isnull",([Forms]![formListParams]![SalesID]))...so
when the form field is null, look at all non-null sales1 records in the
table, else use the form.
For qry2, I've tried similar syntax to test for a null form!salesID field
and if true, then get any non-null sales2id record from the table, else use
the form. I am either using an incorrect implementation of logic or syntax.
Can someone propose a good solution. Seems simple, but I've been staring too
long! Thanks, Dave