IIf([DateDiff]<=30,FormatCurrency([Total]),""). (1 Viewer)

emartel

Registered User.
Local time
Today, 14:54
Joined
Jan 15, 2005
Messages
48
Hi,
I have a query which calculates the date difference between Invoice Due Date and Today, so that I can generate a statement which totals payments 30, 60 and 60+ days late. The query expression is:
Current: IIf([DateDiff]<=30,FormatCurrency([Total]),"").
However, when I try to =Sum([current]), I get a 'Data type mismatch in criteria expression' error warning.
I have tried everything I can to get round this.
Any help gratefully received!!

Ed
 

Mile-O

Back once again...
Local time
Today, 22:54
Joined
Dec 10, 2002
Messages
11,316
Format expressions return a string data type. You can't sum text. Use CCur() to convert current.

i.e.

=Sum(CCur([Current]))
 

emartel

Registered User.
Local time
Today, 14:54
Joined
Jan 15, 2005
Messages
48
Many thanks
I kind of see what you mean - why would it let you format currency then if format is text? Currency is always numerical?
 

Users who are viewing this thread

Top Bottom