DCOUNT in Query

virus

New member
Local time
Today, 14:13
Joined
Feb 12, 2015
Messages
8
Hi there...


I have a problem of DCOUNT, this is my query expression:

DCount("[DUEDATE]", "LNINST", "[DUEDATE] < 42369")

Note: DUEDATE field was converted into numeric character ... where
42369 is equivalent to 12/31/2015..

In DUEDATE field, its include the next maturing date where above 42369 or 12/31/2015. The result of my formula was 2 instead of 1.

Please suggest what expression should i write?

Thanks...
 
try

"[DUEDATE] < #12/31/2015#"

or

"clng([DUEDATE]) < 42369")
 
CJ_LONDON,

it didn't work...
 
DCount("*", "LNINST", "[DUEDATE] < '42369'")
 

Attachments

  • Capture-02.JPG
    Capture-02.JPG
    65.5 KB · Views: 164
on your Expr1 field, instead of Total: Count, use Total: Expression

the expression should be:

Expr1: DCount("*", "LNINST", "[ACC] ='" & [ACC] & "' AND [DUEDATE] < '42369'")
 
on your Expr1 field, instead of Total: Count, use Total: Expression

the expression should be:

Expr1: DCount("*", "LNINST", "[ACC] ='" & [ACC] & "' AND [DUEDATE] < '42369'")

Message box appear...
"The specified field '[ACC]' could refer to more than one table listed in the FROM clause of your SQL statement."
 
Expr1: DCount("*", "LNINST", "[ACC] ='" & [LNACC].[ACC] & "' AND [DUEDATE] < '42369'")
 
what is the datatype of ACC, text or numeric?
 
You don't need DCount() there, you are using an aggregate query already. Just use Count(). You might need to add a unique ID to LNINST and count that, or try counting LNINST.*
 
what is the datatype of ACC, text or numeric?


Got it with this:

DCount("*", "LNINST", "[ACC] ='" & [LNACC].[ACC] & "' AND [DUEDATE] < 42369")

... removing the ' ' of 42369..

thank you so much arnelgp...
 
youre welcome, you might consider MarKk suggestion.
 

Users who are viewing this thread

Back
Top Bottom