DCount function - runtime error.

E

Eroc

When trying to execute the following line
in the immediate window:

DCount("*","tmpTimeLinePayments","[Duration]<='5'")

I get the following error message =
Date type mismatch in Criteria expression.

I really have no idea what I'm doing wrong here.
Any tips/suggestions are most welcome.

TIA.
 
6

'69 Camaro

Hi.

You'll receive Error #3464 with a data type mismatch. If the data type in
the "Duration" field in the table is a numerical data type, then remove the
single quotes surrounding the number 5.

HTH.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address, so that a message
will be forwarded to me.)
 
A

Allen Browne

If Duration is a Number field (not a Text field), drop the extra quotes:
DCount("*","tmpTimeLinePayments","[Duration]<=5")
 
K

Ken Snell [MVP]

Is Duration a numeric data type field? If yes, don't delimit the value being
matched with ' characters:

DCount("*","tmpTimeLinePayments","[Duration]<=5")
 
A

Andi Mayer

When trying to execute the following line
in the immediate window:

DCount("*","tmpTimeLinePayments","[Duration]<='5'")

I get the following error message =
Date type mismatch in Criteria expression.
Duration is numerical, therefor leave the ['] out, this is only for
strings

If you expect an answer to a personal mail, add the word "manfred" to the first 10 lines in the message
MW
 
Top