access is rounding a value

R

Rodolfo Fontes

Hi group,

I have a field on a querie that list the price of the products.
My querie is rounding the values, and i don't want it.
The field is
13_BASE_ICMS: Formato(SeImed([T
NF_S].[Estado_Fat]=[UF_DEFAULT];[BASE_ICMS_PRI]*[REDUCAO];[BASE_ICMS_PRI]);"0000000000")
& "00"
For example:
The value should be:
000000146490
But the querie returns:
000000146500

What should i do to get the value without rounding?

Thanks,
Rodolfo Fontes
 
R

Rodolfo Fontes

Andi,

The result of that is the total in $$.
Both fields are numerical.
Is that what you asked?

Rodolfo Fontes

Andi Mayer said:
Hi group,

I have a field on a querie that list the price of the products.
My querie is rounding the values, and i don't want it.
The field is
13_BASE_ICMS: Formato(SeImed([T
NF_S].[Estado_Fat]=[UF_DEFAULT];[BASE_ICMS_PRI]*[REDUCAO];[BASE_ICMS_PRI]);"0000000000")
& "00"
For example:
The value should be:
000000146490
But the querie returns:
000000146500
whats the result of [BASE_ICMS_PRI]*[REDUCAO] if you use it in the
query?
and what is the data type of this two fields?
 
A

Andi Mayer

Hi group,

I have a field on a querie that list the price of the products.
My querie is rounding the values, and i don't want it.
The field is
13_BASE_ICMS: Formato(SeImed([T
NF_S].[Estado_Fat]=[UF_DEFAULT];[BASE_ICMS_PRI]*[REDUCAO];[BASE_ICMS_PRI]);"0000000000")
& "00"
For example:
The value should be:
000000146490
But the querie returns:
000000146500
whats the result of [BASE_ICMS_PRI]*[REDUCAO] if you use it in the
query?
and what is the data type of this two fields?
 
A

Andi Mayer

Andi,

The result of that is the total in $$.
Both fields are numerical.
Is that what you asked?

which type of numerical: currency, long, double, single ,......
which real result in numbers
is it 146490 or 146500 or 1464.9
 
R

Rodolfo Fontes

It's long type.


Andi Mayer said:
which type of numerical: currency, long, double, single ,......
which real result in numbers
is it 146490 or 146500 or 1464.9
 
R

Rodolfo Fontes

Lynn,

You're right about it.
I've done so to get the "cents" of it.
Hi could i get the "cents" without rounding?
For example, the value x = 1234.12
using format (x;"0000000") = 0001234
using format (x;"0000000") & "00" = 000123400

What should i do to get 000123412 ?

Thanks,
Rodolfo Fontes

Lynn Trapp said:
Rodolfo,

You have told the database to Format the result to 10 digits and then to
concatenate 2 zeros on to that result. 0000001464 is 10 digits, so that's
what it has to work with and, because of the 9 that's missing, it has to
round the final digit to 5, then it concatenates the 2 zeros. Since the
result you want is 12 digits long, try putting 12 zeros in your Format
statement and leave the 2 concatenated zeros off.

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm


Rodolfo Fontes said:
Hi group,

I have a field on a querie that list the price of the products.
My querie is rounding the values, and i don't want it.
The field is
13_BASE_ICMS: Formato(SeImed([T
NF_S].[Estado_Fat]=[UF_DEFAULT];[BASE_ICMS_PRI]*[REDUCAO];[BASE_ICMS_PRI]);"
0000000000")
& "00"
For example:
The value should be:
000000146490
But the querie returns:
000000146500

What should i do to get the value without rounding?

Thanks,
Rodolfo Fontes
 
R

Rodolfo Fontes

This should be like a stupid question, but how do I do that since I've
created a querie for this result?

Lynn Trapp said:
Use a datatype other than Long Integer. Use the Currency datatype.

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm


Rodolfo Fontes said:
Lynn,

You're right about it.
I've done so to get the "cents" of it.
Hi could i get the "cents" without rounding?
For example, the value x = 1234.12
using format (x;"0000000") = 0001234
using format (x;"0000000") & "00" = 000123400

What should i do to get 000123412 ?

Thanks,
Rodolfo Fontes

Lynn Trapp said:
Rodolfo,

You have told the database to Format the result to 10 digits and then
to
concatenate 2 zeros on to that result. 0000001464 is 10 digits, so that's
what it has to work with and, because of the 9 that's missing, it has
to
round the final digit to 5, then it concatenates the 2 zeros. Since the
result you want is 12 digits long, try putting 12 zeros in your Format
statement and leave the 2 concatenated zeros off.

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm


Hi group,

I have a field on a querie that list the price of the products.
My querie is rounding the values, and i don't want it.
The field is
13_BASE_ICMS: Formato(SeImed([T

NF_S].[Estado_Fat]=[UF_DEFAULT];[BASE_ICMS_PRI]*[REDUCAO];[BASE_ICMS_PRI]);"
0000000000")
& "00"
For example:
The value should be:
000000146490
But the querie returns:
000000146500

What should i do to get the value without rounding?

Thanks,
Rodolfo Fontes
 
L

Lynn Trapp

Rodolfo,

You have told the database to Format the result to 10 digits and then to
concatenate 2 zeros on to that result. 0000001464 is 10 digits, so that's
what it has to work with and, because of the 9 that's missing, it has to
round the final digit to 5, then it concatenates the 2 zeros. Since the
result you want is 12 digits long, try putting 12 zeros in your Format
statement and leave the 2 concatenated zeros off.
 
L

Lynn Trapp

Use a datatype other than Long Integer. Use the Currency datatype.

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm


Rodolfo Fontes said:
Lynn,

You're right about it.
I've done so to get the "cents" of it.
Hi could i get the "cents" without rounding?
For example, the value x = 1234.12
using format (x;"0000000") = 0001234
using format (x;"0000000") & "00" = 000123400

What should i do to get 000123412 ?

Thanks,
Rodolfo Fontes

Lynn Trapp said:
Rodolfo,

You have told the database to Format the result to 10 digits and then to
concatenate 2 zeros on to that result. 0000001464 is 10 digits, so that's
what it has to work with and, because of the 9 that's missing, it has to
round the final digit to 5, then it concatenates the 2 zeros. Since the
result you want is 12 digits long, try putting 12 zeros in your Format
statement and leave the 2 concatenated zeros off.

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm


Rodolfo Fontes said:
Hi group,

I have a field on a querie that list the price of the products.
My querie is rounding the values, and i don't want it.
The field is
13_BASE_ICMS: Formato(SeImed([T
NF_S].[Estado_Fat]=[UF_DEFAULT];[BASE_ICMS_PRI]*[REDUCAO];[BASE_ICMS_PRI]);"
0000000000")
& "00"
For example:
The value should be:
000000146490
But the querie returns:
000000146500

What should i do to get the value without rounding?

Thanks,
Rodolfo Fontes
 
L

Lynn Trapp

You have to do that in the tables.

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm


Rodolfo Fontes said:
This should be like a stupid question, but how do I do that since I've
created a querie for this result?

Lynn Trapp said:
Use a datatype other than Long Integer. Use the Currency datatype.

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm


Rodolfo Fontes said:
Lynn,

You're right about it.
I've done so to get the "cents" of it.
Hi could i get the "cents" without rounding?
For example, the value x = 1234.12
using format (x;"0000000") = 0001234
using format (x;"0000000") & "00" = 000123400

What should i do to get 000123412 ?

Thanks,
Rodolfo Fontes

Rodolfo,

You have told the database to Format the result to 10 digits and then
to
concatenate 2 zeros on to that result. 0000001464 is 10 digits, so that's
what it has to work with and, because of the 9 that's missing, it has
to
round the final digit to 5, then it concatenates the 2 zeros. Since the
result you want is 12 digits long, try putting 12 zeros in your Format
statement and leave the 2 concatenated zeros off.

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm


Hi group,

I have a field on a querie that list the price of the products.
My querie is rounding the values, and i don't want it.
The field is
13_BASE_ICMS: Formato(SeImed([T
NF_S].[Estado_Fat]=[UF_DEFAULT];[BASE_ICMS_PRI]*[REDUCAO];[BASE_ICMS_PRI]);"
0000000000")
& "00"
For example:
The value should be:
000000146490
But the querie returns:
000000146500

What should i do to get the value without rounding?

Thanks,
Rodolfo Fontes
 

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

Top