Tables only stores rounded number

misslee1888

New member
Local time
Today, 06:24
Joined
Dec 2, 2002
Messages
98
I have a database in which I have a form which makes some calculations and then creates a word document.

However the problem that I am having is that the numbers are rounded up 2 two decimal places in the form and in the table. However when I view that data in the table it shows the round up figure, however when I click on it is shows me the data to 3 decimal places not rounded up.

Ths issue I have when I create the word doc is that the numbers which are coming over are the un rounded ( either up/or down ) figure to 3 decimal places. Is there anyway which I can make sure that the table only stores the numbers rounded up to 2 decimal places.

Is seems that it only shows that 2 decimal places but the data in the table is really 3 decimal places and not rounded.

Can anyone help?
 
A/ you shouldn't store calculated values.
B/ have you searched here for Round ?
 
I have tried all the round suggestions however what happens is that the code which creates the word document seems to ignore all the formating and uses the full number.

If I view the table the value in the field will be 34.56 however when i click on the field the value which is really in there is 34.561. This is the value which is displayed in the word doc when it is created.

I am not sure how to get around this
 
misslee1888 said:
I have tried all the round suggestions however what happens is that the code which creates the word document seems to ignore all the formating and uses the full number.

If I view the table the value in the field will be 34.56 however when i click on the field the value which is really in there is 34.561. This is the value which is displayed in the word doc when it is created.

I am not sure how to get around this


:confused: :confused: :confused:

How are you importing this info into word?

Are you baseing your word doc on a report?

If you have set your properties in the table and then base a report on that table -- Publish it to word then word just imports the report. So I don't understand why you are having this problem.
 
When I use this method it create a saved word document. Meaning that the user does nt need to save it and it is saved in the proper place with the proper naming convention.
 
misslee1888 said:
When I use this method it create a saved word document. Meaning that the user does nt need to save it and it is saved in the proper place with the proper naming convention.

OK I'll take a look at it when I have 5
 
OK I've taken a look at this and it seems to be working off a form. There has to be away to make it print from a report but I can't see it in a hurry. I may have a play with it when I have more time.

So, as a quick fix base your form on a query with a round expresion like this.

Round([MyNumber],2) this will fix your numbers to 2 decimal places and your report in word will then print OK.

SQL

Code:
SELECT Round([MyNumber],2) AS Expr1
FROM Table1
GROUP BY Table1.MyNumber;

HTH
 
Thanks for that parker. I have never used the that before, there are so many things that I still need to learn and this forum is brilliant.. Can you suggest any books which I could get and have a read at.
 
misslee1888 said:
Thanks for that parker. I have never used the that before, there are so many things that I still need to learn and this forum is brilliant. Can you suggest any books which I could get and have a read at.

Glad to help.

Hmmmm. I’ve already had a few brief discussions on books somewhere. I'm presently reading 'A Treasury of Mississippi River Folklore' edited by B. A. Botkin. But I haven't found any useful Access knowledge in there yet :D

Seriously; Books are a bit like clothes you just get used to the idea of a new one -- purchase it and, suddenly it's gone outa fashion :(

The Access Bible is prob one of the best all rounder's but there is much more info available here and it's free, well except for the occasional ribbing or mild abuse. And, what is more it's international and amusing.

I often don't find a solution or an answer in hard text but I have never (yet) been failed by the good folks on this forum. Most times I don't even bother to ask I just spend some idle time reading posts. I have learned more about Access on here in 4 months than I could have learned in 4 yrs at Uni.
 
Parker,

I am trying too this again using the same concept. This time I have to have a field in the query wich will show the dat as yymmdd. I also have to have another field in the query which shows the date as dd/mm/yy.

I am having a bit of trouble.

I am trying

Format([PODATE],"yymmdd")

in the criteria field but it doesnt seem to like this very much.

Can you help again

Much appreciated.
 
Last edited:
misslee1888 said:
Parker,

I am trying too this again using the same concept. This time I have to have a field in the query wich will show the dat as yymmdd. I also have to have another field in the query which shows the date as dd/mm/yy.

I am having a bit of trouble.

I am trying

Format([PODATE],"yymmdd")

in the criteria field but it doesnt seem to like this very much.

Can you help again

Much appreciated.

Lisa

If you are doing this in a query then right click on the field you want to format and pick 'properties' Scroll down the format bax and pick from the list.
 
Hi Parker

I tried this and it does not work.

Need to have the date in 2 formats in on my report both as yymmdd and as dd/mm/yy.

The problem again is that it shows the field in the query as yymmdd but when you click it is shown as dd/mm/yy.

I need the query to show that date in 2 formats.

Thanks
 
misslee1888 said:
Hi Parker

I tried this and it does not work.

Need to have the date in 2 formats in on my report both as yymmdd and as dd/mm/yy.

The problem again is that it shows the field in the query as yymmdd but when you click it is shown as dd/mm/yy.

I need the query to show that date in 2 formats.

Thanks

Hmm this gets confusing with the routine you are using for word. If you where using a standard Access report then you could just display the date in two fields on the report and alter the format for each on the report. But, using a query it is more difficult without having two independant date fields. Problem is that once you format it one way on a query then any duplicates take on the same format.

Dunno I'll have to think on that unless anyone else can help?
 

Users who are viewing this thread

Back
Top Bottom