View Full Version : 'data type mismatch in criteria expression'


emartel
04-27-2005, 02:26 AM
in a query I am calculating DateDiff. I have an expression which puts a price into a column if datediff < 30. When I try to total that price in a report (in the groupby footer), with the expression =sum([thenameofthatpricecolumn]) I get a 'data type mismatch in criteria expression' error.
I have tried changing everything I can think of to sort the problem out, but it's now driving me insane. If you can help, I will be extremely grateful.

many thanks

Rich
04-27-2005, 03:14 AM
You can't Sum calculated fields in that way, either use a hidden textbox with the running sum property or use =Sum(Iif([YourCriteria]<30,[YourField],0))

emartel
04-27-2005, 03:20 AM
Many thanks.

What is the running sum property?

Brianwarnock
04-27-2005, 04:04 AM
What is the running sum property?

Access help explains it pretty clearly!

emartel
04-27-2005, 04:55 AM
Aha! Thanks - (fingers moving faster than brain)