Comparing Dates in an IIf expression

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

Guest

So I need a calculated field in a query that looks at two dates and depending
on which is later, returns a value of either 0 or the value in another field.

Here's what I have:

Expr2: If([LEASE_START]>DateAdd("m",-11,[
Forms![Month-Year]![Text6]),0,[ABOVE_Line])

LEASE_START and ABOVE_Line are fields in my query.

When I try to run the query I get a "COMP_SALES is not a valid name" error.


Any hints?
 
I do not see "COMP_SALES" anywhere in your statement.

This error is coming from someplace other than the statement you shared with
us.

We can only diagnose what you share with us.

Did you define a parameter, or enter some criteria with "COMP_SALES" in it?
 
COMP_SALES is the name of the query. The query works fine when I don't
include the field with the expression below.

Rick B said:
I do not see "COMP_SALES" anywhere in your statement.

This error is coming from someplace other than the statement you shared with
us.

We can only diagnose what you share with us.

Did you define a parameter, or enter some criteria with "COMP_SALES" in it?

--
Rick B



Elizabeth- MDC said:
So I need a calculated field in a query that looks at two dates and
depending
on which is later, returns a value of either 0 or the value in another
field.

Here's what I have:

Expr2: If([LEASE_START]>DateAdd("m",-11,[
Forms![Month-Year]![Text6]),0,[ABOVE_Line])

LEASE_START and ABOVE_Line are fields in my query.

When I try to run the query I get a "COMP_SALES is not a valid name"
error.


Any hints?
 
Back
Top