conditional query return records >0 access

  • Thread starter Thread starter gymphil
  • Start date Start date
G

gymphil

I am using a query to return all records where stock receipts are greater
than zero. IIf([forms]![smbt].[type1]="receipts",'>0',",")
This is only returning records where receipts = zero!
Can anyone assist?
 
IIF is a true/false condition. So for all records where type1 is a receipt
then it will return '>0' else it will return ','. It would be easier to
simply filter the records for all receipts which are greater than zero by
inserting '>0' into the criteria line for the field.
 
If that is supposed to be criteria you could try:

Field: SomeField
Criteria: (> 0 and Forms!smbt!Type1 = "receipts") Or Forms!smbt!Type1 <>
"Receipts"


John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
 
Many thanks John, it works a treat!

Phil

John Spencer said:
If that is supposed to be criteria you could try:

Field: SomeField
Criteria: (> 0 and Forms!smbt!Type1 = "receipts") Or Forms!smbt!Type1 <>
"Receipts"


John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
I am using a query to return all records where stock receipts are greater
than zero. IIf([forms]![smbt].[type1]="receipts",'>0',",")
This is only returning records where receipts = zero!
Can anyone assist?
 
Back
Top