Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / April 2006

Tip: Looking for answers? Try searching our database.

Fields format

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Redwood - 06 Apr 2006 14:18 GMT
I have some fields in a table which store calculation results. I use update
query to update the fields. The calculation formula likes this: A*B/C. The
problem is if the feilds type in the table is Number, format is fixed and
Decimal places is  in 2, after update, the data like this: 234.00, 33.00. The
real results should be 234.67, 33.55. If the fields type in table is text.
after update, the data like this, 234.6712, 33.5468. We I use these fields to
create a report, I can't let the data show in 2 digit decimal,
no metter I set the format in fixed, decimal places is in 2. The data alweys
show 4 or decimal.
Nikos Yannacopoulos - 06 Apr 2006 14:29 GMT
You are losing the decimal part because you have selected (or Access has
defaulted in) an integer field size (either Integer or Long). You need
to change that setting to Double.

By the way, if you can calculate the value so easily from data that is
already there, in principle you should not store the calculation result,
you should just recalculate whenever required. Storing is required only
if the calculation is based on temporary data that will not be available
in the future.

HTH,
Nikos

> I have some fields in a table which store calculation results. I use update
> query to update the fields. The calculation formula likes this: A*B/C. The
[quoted text clipped - 5 lines]
> no metter I set the format in fixed, decimal places is in 2. The data alweys
> show 4 or decimal.
Rick B - 06 Apr 2006 14:37 GMT
Redwood:

why are you storing a calculated result in a table?  Your value will only be
correct as of the last time you ran your update query.

Instead, just calculate it in your queries, reports, and forms.

Signature

Rick B

>I have some fields in a table which store calculation results. I use update
> query to update the fields. The calculation formula likes this: A*B/C. The
[quoted text clipped - 8 lines]
> alweys
> show 4 or decimal.
Redwood - 06 Apr 2006 16:46 GMT
Thank you very much for your help. I get it.

Thank you very much for the tip, Rick. I understant your means. I used to
not do like that. This time I need to store the calculation data into the
table because somebody wants me to calculate it and put it in the table, so
they can easily pull out the data from the table and look at or perform the
analysis whatever they want.

> Redwood:
>
[quoted text clipped - 15 lines]
> > alweys
> > show 4 or decimal.
Rick B - 06 Apr 2006 16:48 GMT
Hmmm.  That still is not a reason to store it.  They can use a query instead
of a table.  Just create a query for them.

Signature

Rick B

> Thank you very much for your help. I get it.
>
[quoted text clipped - 32 lines]
>> > alweys
>> > show 4 or decimal.
Redwood - 06 Apr 2006 17:05 GMT
Ok, I will try to talk to them and create a new query for them.

> Hmmm.  That still is not a reason to store it.  They can use a query instead
> of a table.  Just create a query for them.
[quoted text clipped - 35 lines]
> >> > alweys
> >> > show 4 or decimal.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.