tb
Programmer
- May 27, 2003
- 328
Hi all,
Can anyone tell me what I am doing wrong in this query?
(Generic Query Designer)
Basicaaly what I want to achieve is ...
When "ALL" Sales Rep name is selected it will only use Region as part of the WHERE clause otherwise it must use both the Region and Sales Rep selections in the WHERE clause of the Dataset query.
Any comments would be much appreciated.
="SELECT Region, CustName AS 'Customer Name', Custnmbr AS 'Customer Number', Contnbr AS 'Service Number', " &
" LastManifest AS 'Last Manifest Date', " &
" Datasheetnumber AS 'Datasheet Number', " &
" RateID AS 'Rate Number', ExpiryDate AS 'Expiry Date', " SLPRSNID, " &
" Cleanup_Permanent AS 'Service Type'" &
"FROM evs_LinkedDatasheetExpiry_Current " &
IIF (Parameters!Rep.Value = 0, "WHERE Region = " & Parameters!Region.Value & ", "WHERE Region = " & Parameters!Region.Value & " AND SLPRSNID = " & Parameters!Rep.Value & ")"
I was standing in the park, wondering why frisbees got bigger as they came closer... then it hit me!
Can anyone tell me what I am doing wrong in this query?
(Generic Query Designer)
Basicaaly what I want to achieve is ...
When "ALL" Sales Rep name is selected it will only use Region as part of the WHERE clause otherwise it must use both the Region and Sales Rep selections in the WHERE clause of the Dataset query.
Any comments would be much appreciated.
="SELECT Region, CustName AS 'Customer Name', Custnmbr AS 'Customer Number', Contnbr AS 'Service Number', " &
" LastManifest AS 'Last Manifest Date', " &
" Datasheetnumber AS 'Datasheet Number', " &
" RateID AS 'Rate Number', ExpiryDate AS 'Expiry Date', " SLPRSNID, " &
" Cleanup_Permanent AS 'Service Type'" &
"FROM evs_LinkedDatasheetExpiry_Current " &
IIF (Parameters!Rep.Value = 0, "WHERE Region = " & Parameters!Region.Value & ", "WHERE Region = " & Parameters!Region.Value & " AND SLPRSNID = " & Parameters!Rep.Value & ")"
I was standing in the park, wondering why frisbees got bigger as they came closer... then it hit me!