Rounding, MAKE IT STOP!

D

Dos Equis

Hi all,

Using this code:

SELECT qry_CarrierSummary.Carrier, qry_CarrierSummary.[Sub Pay],
qry_CarrierSummary.[Pay for homes], Format(CInt([Sub Pay])+CInt([Pay
for homes]),"Currency") AS [Carrier Pay]
FROM qry_CarrierSummary
GROUP BY qry_CarrierSummary.Carrier, qry_CarrierSummary.[Sub Pay],
qry_CarrierSummary.[Pay for homes];

I get a result from my query which is rounded to the nearest dollar. I
know it's because of the CInt() function and I want to get away from
using it. The problem is that 1) Val() returns 0's and 2) I don't know
how to declare that the value returned from the original query is a
number (currency). Please point me in the correct direction...

Byron
 
P

Phil Smith

CInt() is for integers.
CCur() is for currency.
Replace one for the other, and you should be good to go.
 
D

Dos Equis

I hate when it's that simple. Wish MS Help or any of my books would
have pointed me in that direction... THANK YOU!

Byron


Phil said:
CInt() is for integers.
CCur() is for currency.
Replace one for the other, and you should be good to go.


Dos said:
Hi all,

Using this code:

SELECT qry_CarrierSummary.Carrier, qry_CarrierSummary.[Sub Pay],
qry_CarrierSummary.[Pay for homes], Format(CInt([Sub Pay])+CInt([Pay
for homes]),"Currency") AS [Carrier Pay]
FROM qry_CarrierSummary
GROUP BY qry_CarrierSummary.Carrier, qry_CarrierSummary.[Sub Pay],
qry_CarrierSummary.[Pay for homes];

I get a result from my query which is rounded to the nearest dollar. I
know it's because of the CInt() function and I want to get away from
using it. The problem is that 1) Val() returns 0's and 2) I don't know
how to declare that the value returned from the original query is a
number (currency). Please point me in the correct direction...

Byron
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top