find a date within a range of dates

  • Thread starter Thread starter Gab
  • Start date Start date
G

Gab

hi i'm trying to find a date within a range and i'm using this expression
IIF([createdDate] in [InvoiceDate]-60,â€Yâ€,â€Nâ€)
the creation date should be within invoice date - 60 days.
am i using the expression correctly?
It seems to ignore the -60 days window
Thanks for your help
 
am i using the expression correctly?
Yep.
I think this is what you want. In design view --
Field: createdDate
Criteria: Between [InvoiceDate] And [InvoiceDate]-60
 
Gab said:
hi i'm trying to find a date within a range and i'm using this expression
IIF([createdDate] in [InvoiceDate]-60,”Y”,”N”)
the creation date should be within invoice date - 60 days.
am i using the expression correctly?


The IN operator works differently from what you apparently
think it does. Try something more like:

IIf(createdDate Between DateAdd("d", -60, InvoiceDate) And
InvoiceDate), ”Y”, ”N”)

Since I have no idea what you mean by "find a date", this
whole discussion could be going down a fruitless path.
 
Back
Top