Query - Weird Decimals Return

Sep 7, 2005

I enter values into a table with 2 decimal places.

I have a query that applies percents to the values - I have set the results to have 2 decimal places.

I have another query that summarises data from the previous query, however the results I get are not right, the decimals differ from the actual result, if I make a sum of the values by hand.

It seems as if the query I have made to apply percents only DISPLAYS data with 2 decimals instead of actually rounding it, so that the other query summarises data with more than 2 decimals, and thats where the difference int the end result comes from. I don't know how to fix this however.

Can someone please help.

Thanks!

View Replies


ADVERTISEMENT

Return Age With Decimals?

Oct 18, 2012

Is it possible to return an age as: 21.45 or 64.93?

I have done some searching and can't find any formatting or code to make it work.

I have changed the field format to Fixed and then it gives: 21.00 or 64.00

I like the 2 decimal places for quick at-a-glance-knowing of the age.

Of course I have a formula that returns an age with decimals in EXCEL, that's why I think it should somehow be possible in Access.

View 1 Replies View Related

Queries :: Carriage Return - Format Data So It Will Export With 2 Decimals?

Nov 4, 2014

When using the carriage return how do I format the data so it will export with 2 decimals?

In the example below I need the Estimated Material Cost to export in in format: 500.00 --- NOT 500.

MTLCost: [Estimated Material Cost] & Chr(13) & Chr(10) & [C]

View 8 Replies View Related

Modules & VBA :: Return Rows In Query From Variant Array Return From UDF

Sep 16, 2014

I have a simple UDF that takes a string and returns a variant, which is an array of strings Example Input "Brick Wall" Return value would be a variant array with first element "Brick" and and second element "Wall" Now I have a table with a field of strings, and I want to make a query that returns all the results from the function, one per line.

So if my input table looks like this

[strField]
"kick the ball"
"return the pass"

my query result should looks like this

[Orig] [new]
"kick the ball" "kick"
"kick the ball" "the"
"kick the ball" "ball"
"return the pass" "return"
"return the pass" "the"
"return the pass" "pass"

Last time I had to do something like this I used VBA exclusively, with ADO objects, but I thought a query based solution would be easier.

With my current data the largest return array size my function returns is 27 elements but I wouldn't want to rely on that number being fixed.

View 3 Replies View Related

Queries :: Insert Query Losing Decimals

Feb 4, 2014

So, I am inserting new records into a table. The values in the decimals are being stored as zeroes.

Field Properties
Long Integer
Standard (I also tried Currency)
2 Decimal Places

When I remove the "INSERT INTO" part of the query, the decimal data is in the results. I started out not using the FORMAT function. Then I tried it using "Standard", "Currency", and "#,##0.00"

View 3 Replies View Related

Weird Query Results

Feb 6, 2008

I have a simple query based on two fields that saysComponent4 total = no of hours sleep/no of hours in bed * 100where no of hours sleep = 9no of hours in bed = 10therefore component 4 total should = 90 instead it equals 89.999999How can this be?For all the other records the answer is correct down to the very last decimal place.When I right click on the query for this component 4 total and change the format from general number to standard it will correctly respond to 90 but only because the numbers are being rounded up.PS. THe numbers are definitely being stored and recalled as 9 and 10 and arent being rounded up because I inputed it as 9.0 and 10.0.

View 3 Replies View Related

Weird Bug: OutputTo Deletes (!) Query

Dec 1, 2007

Hi guys & gals,

I recently came across this really strange behaviour and was wondering if anyone else knows this bug or knows a better workaround than mine.

I've attached a little Events DB, which has a search interface. I've included an export button, which runs a macro that does an OutputTo (xls) of the search query.

Now if you do an export once, everthing is fine. The bug (at least I think it's a bug) occurs if you export a *second* time and *overwrite* the file you created earlier. The search query (which sits under the "Queries") tab is now empty and you get an error message.

My workaround idea was to dump the query to a new table every time you export and then do an OutputTo with this table. Not very elegant and you also have to do the whole error handling (e.g. user presses cancel) manually.

Does anyone have a better idea? Or am I doing somethng completely wrong and this is actually "by design"?!

Thanks in advance for any ideas!

View 2 Replies View Related

Weird Query Select Behavior

Nov 13, 2006

Help!

I have one table that deals with project details. Then I have one table that deals with project history. Obviously each project has a bunch of unique details and several related records detailing the project history.

My goal is to be able to read details of any project along with the last history entry.

1-I have one query that gives me the last history comment. It creates a table.
2-Then I have another query that gives me the details of the project along with all the project history. It creates another table.
3-Then I have a select query that joins the first table and the second table comparing the project history comments and only showing the records that have the same comment. Therefore I get exactly what I need; The details of a project along with the last history comment.

The problem: I get the correct records selected, however 1) if the first entry in the project history table in one or several records is one word, then the query results include those records repeated a random numebr of times. 2)If the first entry in the project history table in one or several records is two words, then the query results include those records repeated a random number of times, but less times. 3) If the first entry in the project history table in one or several records is three words, then the query results include those records repeated a random number of times, but only a few times. 4) If the first entry in the project history table in one or several records is three words or more (on average), then the query results include only the record I wanted once.

What is going on?!??!?!?!

It almost looks like the query is runing once and again until a certain number of words are compared....

This is weird.

Anyone has any idea?

thanks

mafhobb

View 2 Replies View Related

Weird Error With Append Query.

Aug 23, 2007

Hey guys (again :o)

I've encountered another weird error when applying an append query through a button. Here's the code:

Private Sub cmdSaveChanges_Click()

On Error GoTo Err_cmdSaveChanges_Click
'Saves the new Inspector information into the information table.
'Adds the two references created by adding a new inspector into the XREF_FILE_INSPECTOR table.
'This is the case that the references are formed by adding a completely new inspector.
If (IsNull(cmbInspector) Or Me.cmbInspector = "") Then

'Saves Inspector information
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
'Adds references
DoCmd.RunSQL "INSERT INTO XREF_FILE_INSPECTOR" _
& "(FILE_NUMBER_CD, INSPECTOR_NUMBER_CD) VALUES " _
& "(" & [Forms]![GeneralFile].[txtGeneralFileNumber] & "," & [Forms]![AddInspector].[txtInspectorNumber] & ");"


Else
'This is the case where the user chooses an inspector from the provided combo box.
DoCmd.RunSQL "INSERT INTO XREF_FILE_INSPECTOR " _
& "(FILE_NUMBER_CD, INSPECTOR_NUMBER_CD) VALUES " _
& "(" & [Forms]![GeneralFile].[txtGeneralFileNumber] & "," & cmbInspector.Column(0) & " );"
End If
Exit_cmdSaveChanges_Click:
Exit Sub

Err_cmdSaveChanges_Click:
MsgBox Err.Description
Resume Exit_cmdSaveChanges_Click
End Sub

The problem is, when I run this I get a "Syntax error in INSERT INTO statement". This seems to only be the case for the first part of the IF statement, as the second part's append query works fine.

Help!

View 2 Replies View Related

Hiding Decimals

Aug 31, 2005

Hello,I was wondering if anybody knew if it was posslble to show an aproximated value of a field with decimal records. I would like to see only integer values on my form.

View 3 Replies View Related

Decimals And Rounding

Oct 27, 2005

I have a field that holds a unit price. I can't use currency as the data type because the currency type is different for each client. I have another field that specifies the currency type for each department. Up to now I've been using a double format with a 2 decimal places. We now need to increase the decimal places to 4 but don't necessarily want to see all four places if only 2 are required - 1.5000 against 1.50. However if I make the decimals as auto, if I have 1.50 it rounds to 1.5.

Any other way to give a bit of flexibility to this?

Thanks.

Dawn

View 8 Replies View Related

Rouning Decimals

Feb 23, 2005

I am trying to round decimals to either .5 or 0 right now i have it set to 1 decimal place and it rounds to to the next place. So if a user puts in 1.23 it would round to 1.2 instead of 1.0, is there a simple way to solve this issue?

View 1 Replies View Related

Help With Decimals In Form Field.

Apr 6, 2006

I have a tblParts that has data in this format 200200.0100 (these are bin numbers). I have created a form with a bound field (field name on the form is BinNo) that goes back to the tblParts. I need to be able for the user to enter on the form the Bin number as it appears above. However at the moment it is dropping my decimal and is only keeping the 200200 portion of the Bin Number. If I enter the bin number correctly into the table it accepts the correct format of 200200.0100. Can someone take a look at the form and the field BinNo to tell me what I may have missed.
Keep in mind that the goal of the database is to enter the bin number into the form and run a query that creates a new table. There is also a delete table button since the data in the form will change for each blueprint document created.
I am attempting to attach a practice db for you to see what I have done but I have not had much success with this in the past. Thanks in advance for your help.

View 3 Replies View Related

Troubles Calculating Sum For Decimals

Jul 7, 2005

Hi everybody,

I have to calculate somme totals for decimal numbers, and... I can't make it to work.
I have a report:

Quantity Unit_price Price_without_Taxes Taxes Price
2 1,62 3,24 0,62 3,86
2 2,13 4,26 0,81 5,07
TI: 8,91

TI it's the sum of Price, and here is the problem, because the value of TI should be 8,93 Euro (3,86+5,07) not 8,91. In this case it's a loss of 3 cent , but in other cases, if i have more value to calculate the sum for I can loss a few euro!

The values are placed in the detail section, TI on the footer section of the report. To calculate TI I used a Text box wich format is currency, Decimal places 2, Control source =Sum([Price]).

I make this same calculations on forms also, there the situation it's worst, the value it's rounding down or up in each case, in this particular case insted of 8,93 I got 8,00.

What's wrong with it? I'm making mistakes somwhere?
Any help is apreciated. I need it soooooo bedly! :)

Thanx,
Attila

View 14 Replies View Related

Importing, Currency And Decimals

May 22, 2006

I'm having a problem getting imported data to display what I want. I'm importing a fixed width file and one of my fields is a currency amount. The field value in the file is 12 characters with the last 2 as the cents (000000544990) I have my access field type as currency with 2 decimals (and I've tried many other settings auto,0 etc.) When I do my import it displays my data as $544,990.00 If I tell it no decimals it displays $544,990 It should be displayed as $5,449.90 somehow it keeps adding 2 characters and uses them as the cents instead of using the last 2 from my file.

Any suggestions?

Thanks for helping me out.

Rick

View 9 Replies View Related

Whats Controlling These Decimals?

Jan 5, 2007

Hello,

Dont understand what is controlling these decimals. I dont need any decimals for this database. The currency is talking bout money in 1000's and the probability is whole numbers.

Here is where I cant get the decimals to stop:

http://img80.imageshack.us/img80/3685/untitled2pl2.png
http://img77.imageshack.us/img77/6276/untitled3pa6.png
http://img208.imageshack.us/img208/2047/untitled3lk8.png

I have tried different things but no luck...anyone have any suggestions.

Thanks.

View 10 Replies View Related

Setting Up Form To Allow Decimals

Mar 23, 2006

I need to have a field on my form to accept the user keying in the number in this fashion: 200200.1234 but as I currently have it set it accepts only the 200200 portion of this part number. I am a beginner so I am sure this is an easy question for some of the pros out there.

As a footnote the table design has the bin no. as data type - text and I added an input mask of 000000.0000;0; the field on the form is a combo box. Maybe that will make a clear picture for you.

Thanks in advance for your assistance.

View 5 Replies View Related

Decimals Changing To Zeros

Mar 1, 2013

I have a table that I need to enter values into but for some reason when I enter a decimal (ex: .015), it automatically changes to 0. I have the Data Type set as Number, Field Size as Long Integer and Decimal Places to 3. I have another field set the same way and it works fine.

View 2 Replies View Related

Specifying Number Of Decimals When Exporting Data

Oct 31, 2007

Hi,
I use the built in tools "Analyze data with excel to export" to export data from froms to excel and it works fine. The only problem is in the form and table I had specified 3 decimals but in excel the data is two decimals and I have to always reformat the cells manually to 3 decimals.

Any way to have this set when exporting even if I have to use VBA code.

Thank you.

View 2 Replies View Related

Calculation....need To Drop The Decimals In The Result.

May 2, 2008

Here's what I have so far...and it works fine; however, some results have decimal places; i.e., 2.1666666.

I just need the result to be the whole number. I can't seem to get it to come out that way...I've used "round"...but I must not be putting it in the right part of the formula.

TEST: IIf(Year([EndTerm])>Year(Date()),0,IIf((Year(Date())-Year([EndTerm]))/[Renew]<1,1,(Year(Date())-Year([EndTerm]))/[Renew]))


Thank you for any help!
Carol

View 2 Replies View Related

Can't Get My Weight Field To Accept Decimals...???

Aug 14, 2005

I've got a products table in which I have a field called weight. Obviously, this is to hold the weight of the item. I've it set to Number | Long Integer with desimal places set to 2. However, when I put 2.5 it makes it 2.

What could be causing this?

View 1 Replies View Related

Enabling Decimals And Fractions In MS ACCESS

Feb 17, 2007

I am trying to develop a customized program in MS Access,
but one of the input parameters needs to be a decimal or
fraction (ie: I need to enter values that are not whole number
integers). Unfortunately, it seems that MS Access won't
enable me to input values that are not whole number integers.
I had this same difficulty in the past, and in that case, it turned out that the non-integer value was not used. But in
the current program I'm trying to develop, I definitely need
to get the non-integer data inputting to work, since the
parameter that I'm entering these values for is "percentage".
It turns out that if I enter a value from 0.51 to 1, it rounds
up to 100%, and if I enter a value that's 0.5 or lower, it rounds down to 0%. There is no in-between. I tried looking
into the various settings in DESIGN mode, but nothing seems
to correct this problem. Is there anyone out there reading
this that has insight into my problem? Could my version of
MS Access have a software corruption? Or is there just a
setting that I've overlooked? I appreciate any advice that
can be offered. Thanks for your help.

View 3 Replies View Related

Queries :: Set Decimals In Expression On Dates

Feb 19, 2014

Using Access 2007
Win 7

Total_Time: Format(nz(DateDiff("n",[Start],[End])/60))

This is my expression in a query.

I need to only show 2 decimal places in the results field.

View 6 Replies View Related

Modules & VBA :: Filling With Zeros For Two Decimals Places

May 1, 2014

I'm passing a few numbers on to Word and these should always appear with two decimal places, also if it's a whole number etc.

e.g.: 10 -> 10,00 or 9,8 -> 9,80

Depending on the regional settings, the decimal marker can be . or ,

View 4 Replies View Related

Queries :: Formatting Whole Numbers And Decimals Differently

Nov 26, 2013

I want to print the results of a query where some values are whole numbers, some have 1 decimal place, some have 0.3333333 recurring etc. Problem is that in order to fit all the columns on a page the column width does not allow all the 0.33333... to display. So what I see is like this (there are lots of columns, I am just giving an example from one column)

891
833.5
######

I don't want to fix decimal places to 1 because then I would see 891.0 instead of 891. How can I format the number field so that whole numbers are shown without decimal place, numbers with 1 decimal place stay like that i.e. 833.5 is fine as it is. But display something like 313.666666666667 as 313.67 rather than ##### getting put in as not enough room for all the decimal numbers.

View 5 Replies View Related

Forms :: Listbox Results To Show 3 Decimals?

May 30, 2013

I have a list box that is fed by a query. I have fields that are stored in the table as numbers (Type is Double and Standard Number with 3 decimal places).

In the tables I see the numbers 10.000 which is correct, in the query is see 10.000 again correct, however the list box on the form only shows 10.00?

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved