View Single Post
  #2  
Old May 3rd, 2010, 09:26 PM posted to microsoft.public.access.queries
vanderghast
external usenet poster
 
Posts: 593
Default DateDiff with variable criteria?

Try:


= IIf([tblCustomerUS.strCustomerId] In ("LE4212","AM0303"),80,50)


since the goal of iif is about returning a constant, not about returning a "
part of " a test.

Vanderghast, Access MVP



"Jim" wrote in message
...
I have a query field that uses DateDiff("d",[dtmDateShipped],[dtmDatePaid])
to calculate the difference between a ship date and paid date. I also have
=50 in the criteria row to restrict payments to 50 days or less.



I need to change the criteria to =80 for a couple customers. I've tried
using IIf([tblCustomerUS.strCustomerId] In ("LE4212","AM0303"),=80,=50)
in the criteria row as a sub query, but I get no results at all. Any
suggestions on how to set this up correctly?

Thanks



Jim