If you have this expression in the Field row of your query, then it should work. I just
tried a slightly altered version in the Northwind database, using the Orders table:
DateDiff("d",Now(),OrderDate)
Access volunteered a column alias and placed square brackets around the field name:
Expr1: DateDiff("d",Now(),[OrderDate])
The differences calculated were negative numbers. No biggie. Just reverse the
parameters, as in:
Expr1: DateDiff("d",[OrderDate],Now())
to get a positive number of days. The bottom line is it should work. Your error message
is indicating a datatype mismatch in the criteria row. What type of criteria are you
including?
___________________________________________
"Rimdur" <no****@home.cc> wrote in message news:%XJnb.3194$2o2.18269@amstwist00...
I am trying to get a difference between two dates calculated in a query. I
have Sales_Date as the first one, and Date() as the second one. How would I
put the difference of these two days into a field?
I have tried something like this:
DateDiff("d", Now(), Sales_Date)
Then I get an error like this:
"Datatype mismatch in criteria expression". Sales_Date is formatted as a
Date format.
-Thanks for all help