Expression in Query not formating correctly

weilerdo

Registered User.
Local time
Today, 10:16
Joined
Apr 21, 2005
Messages
109
Hi all,

I have a query that I have an expression in that is returning a text value instead of a number value. The field in my table is a number value but when I use the expression it returns it as text. I have done several searched but can't seem to find anything that matches formatting an expression as a number. Here is the expression I am using, the reason I am using it is because I need to return a zero if no records matched the criteria.

total: Nz(Sum([act_hours]),0)

Thanks
 
Try this:
Code:
total: CDbl(Nz(Sum([act_hours]),0))

replacing CDbl with CInt (if you want an integer instead of double), CLng (if you want a long integer instead of a double), CSng (for a single instead of a double), etc.
 
total: Nz(Sum([act_hours])) +0
.
 
Thanks

Thanks Guys..... that worked great your lifesavers...
 

Users who are viewing this thread

Back
Top Bottom