=( why is this Data Mismatch?????

kwokv616

Registered User.
Local time
Today, 02:19
Joined
Nov 10, 2008
Messages
46
=( what is wrong with this...
when i run the query it says "data type mismatch in criteria expression"...

Field
aprid: Sum(([prem]+[eprem_o]+[eprem_m])*1*IIf((Not (
Code:
=[rcode]) And Not ([rcode]=("TOPUP" Or "FSB" Or "FSSB" Or "MKB"))) And ([status]="I" Or ([status]="P" And Not (IsEmpty([edate])))),1,0))
[B]Total[/B]
Expression
 
[B]Field[/B]
apTU: Sum(([prem]+[eprem_o]+[eprem_m])*1*IIf([rcode]=("TOPUP" Or "FSB" Or "FSSB" Or "MKB") And ([status]="I" Or ([status]="P" And Not (IsEmpty([edate])))),1,0))
[B]Total[/B]
Expression
Thank you!!
 
Try replacing:

IsEmpty([edate])

...with:

IsDate([edate])=False
 
Also, this:

[rcode]=("TOPUP" Or "FSB" Or "FSSB" Or "MKB")

would have to be:

[rcode]="TOPUP" Or [rcode]="FSB" Or [rcode]="FSSB" Or [rcode]="MKB"

I can't remember if "IN" works within an IIf, but you could try:

[rcode] IN("TOPUP", "FSB", "FSSB", "MKB")
 
i changed the both expressions but...this time...it says..."you tired to execute a query that does not include the specified expression 'Dur1' as part of an aggregate function"

why is this happening????
 
Which changes resulted in this new error? There were several suggested.

I suspect that the sources for this query are other queries, and that "Dur1" may be a value calculated by, or populated by a VBA function contained within one of the underlying queries which has not had it's value calculated or defined.

I'd suggest you break this down to sub-parts, and build it one field at a time, and one piece at a time, so you can determine exactly what portion of the formula is causing the mismatch, or calling the Dur1 expression (and what Dur1 needs in order to resolve its value).
 
Can you post your full and current SQL, including the fix(es) you did?
 

Users who are viewing this thread

Back
Top Bottom