473,386 Members | 1,738 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Decimal value problem in access 97 Report

3
I have a Integer Value 0.75 in form field and want same value in report, i've set the field property as below at report objects.
Property 0 & Format - General No > Result: 0.8
Property 0 & Format - Fixed > Result: 0.75( this field is coming exactly what I want but changing other field value 9 to 9.00)

Please help me to sort out this issue.
Oct 15 '11 #1
6 3704
Stewart Ross
2,545 Expert Mod 2GB
If use of the general format is rounding your value to 0.8 it suggests you may have defined the value in your table as a single-precision number. I would suggest defining the value as a double-precision number instead.

Regarding the display of 9.00 for the whole number value 9, the textbox format is working correctly. In fixed format with two decimal places all whole number values will indeed show as X.00, where X stands for the whole number being displayed. This is quite normal, and indeed is what is needed for report purposes to line up the decimal point. Otherwise, the values displayed on successive detail lines will look very untidy (e.g.

Expand|Select|Wrap|Line Numbers
  1.      9
  2.   0.75
  3.    100
  4. 10.251  (and so on) instead of 
  5.  
  6.   9.00
  7.   0.75
  8. 100.00
  9.  10.25
-Stewart
Oct 15 '11 #2
NeoPa
32,556 Expert Mod 16PB
Other viable options are the Data Type = Currency and Field Size = Decimal. These are there to ensure absolute reliability when dealing with decimal numbers and that no rounding errors occur.

Of course you must ensure not to confuse the Formatting with the holding of the data. Just because a field displays a number one way, doesn't necessarily reflect the precision it's held to.
Oct 15 '11 #3
Sammer
3
Thanks Stewart for your detailed reply.
The value in my table for the field is Number , Double.
This is client approved report where we have to maintain the same standard as earlier (0.75 and others 9 only).

Thanks,
Oct 17 '11 #4
Stewart Ross
2,545 Expert Mod 2GB
If you really need to differentiate between different values in your report you can use the Format function in conjunction with an IIF (in-line IF statement) as follows.

First, change the name of the textbox concerned - if it was previously call item_total, say, change it to something different but appropriate like txtItem_total_formatted. The change is to avoid a circular reference occurring in the calculated value for the control source.

Then, change the control source property so instead of the textbox referring directly to the underlying field it is a calculated field, like this:

Expand|Select|Wrap|Line Numbers
  1. =IIF([Item_total] < 1, Format([Item_Total], "0.00"), Format([Item_total], "0"))
You will need to use whatever the real name of the field concerned is in place of Item_total listed above. You must make sure you include the equals sign before the IIF statement.

This will format values that are less than 1 with two decimal places, but valus over 1 as whole numbers. You can change this threshold to whatever suits you as necessary.

-Stewart
Oct 17 '11 #5
Sammer
3
I just found that i am getting correct value (0.75) on 2 pcs. our's the domain network. i tried and change all the setting( Regional setting, database field properties, Report properties same as these 2 correctly working Pcs on others Pcs but still getting the same value (0.8). Dont know what and why its happening....please help.
Oct 19 '11 #6
NeoPa
32,556 Expert Mod 16PB
@Sammer
Very little of what you say gives us anything to work with. You half say things and expect us to guess what you're talking about. I tried to make sense of it by starting again at the beginning, only to find :
Sammer:
I have a Integer Value 0.75
This is thoroughly nonsensical. Integers have no decimal points.

Also we've seen no code and little helpful design information from you so when you post a few words saying you're still getting the same values on some PCs we're in no better position to help. If you want help then you'll have to start posting more sensible replies.
Oct 19 '11 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Nicola | last post by:
Hi Everyone, I am new to programming and would like to know how to open an access Report from within vb 6. I am trying to write a program to organise cross stitch threads. I have found out how...
8
by: Mike MacSween | last post by:
tblCourses one to many to tblEvents. A course may have an intro workshop (a type of event), a mid course workshop, a final exam. Or any combination. Or something different in the future. At...
4
by: Greg Teets | last post by:
I am running an Access report from VB via ADO. The report has a field that shows the time it was run. Is it possible to return the data from this field to VB when the report runs? Or to find...
4
by: spebola | last post by:
I am using vb.net 2003 professional and I get the following results when using the round method: dim Amount as decimal = 180.255 Amount = Amount.Round(Amount, 2) Amount now contains 180.25. ...
4
by: dkelly925 | last post by:
I have an Access Report that I am trying to enter an "If Statement" that when a certain field exceeds a certain number of lines or a certain number of characters that field is not visible and...
1
by: ellenh | last post by:
I have read postings on the similar subject including the posting from 2003 shown below. This process works fine to display a single page snapshot report in PowerPoint. I need to display...
6
by: DeniseY | last post by:
I have an Access report that is created on the fly by the user selecting the fields to be included. The Access report comes out fine, but I want it to automatically output to an Excel spreadsheet....
6
by: ssq | last post by:
I have an access Report A generated by Query A, I copied Query A as Query B and replaced some columns by adding new columns. So when ever I run Report A now referred to Query B I am getting the pop...
0
by: keithsimpson3973 | last post by:
Does anyone know if it is possible to display the value of a date picker control on a vb6 form that the user selected on an access report? I am using vb6 to display a report selection and it has a...
0
by: shalskedar | last post by:
The grandtotal in Access REport is not matching with the total in Excel, when this report is exported from Access to Excel..... Can i get the solution for this
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.