Using an "IF" formula within a query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Not sure if it can be done or not, i am trying to create a query with an "IF"
formula in it, when if a field is greater the "1" it will open "query/report
1", and if the field is equal to "0" it will open "query/report 2"

Thanks for your help in advance!
 
You should use the IIF to give you the result

IIF([FieldName]>1,[query/report 1],[query/report 2])
Will return [query/report 2] If my field = 0 or < 0.

To return [query/report 2] only when my field =0 then you should use IIF
within IIF
IIF([FieldName]>1,[query/report 1],IIF([FieldName]=0),[query/report 2]))
 
If you mean that depending on the value of the field in the query, you want the
query to open a different report then the answer is that it cannot be done.

Queries do not call reports - reports use queries as record sources and
therefore they "call" a query.

Can you explain the problem you are trying to solve?
 
Back
Top