Solved

MS Access sort problem

Posted on 2009-04-10
4
299 Views
Last Modified: 2013-11-29
I have a field that will contain unique numbers to identify an item in the following format

456.987
342.650
5.643
34.890

This field will be used to link tables with a one to many relationship.

I need the decimal places to always show the zero at the end if it applies

I would like to sort these based on the numerical values displayed in the field

I defined Field Size to Long Integer
If I define as a Number data type with a Format of ###.000 decimal places 3, entries are rounded up to the next whole number with zeros in the decimal places.
If I define as a Number data type with a Format of ###.##0 Access automatically changes it to #.000 with the same results as above.
If I define as a Number data type with a Format of  ###.### the rounding to the next whole number happens.
If I do not supply a format then only a whole number is shown even if decimal values are entered.
If I define the field as a Text data type then the sort of course is not numerically correct.

I am hoping it something simple that I am missing otherwise a work around to make this happen would be great.
0
Comment
Question by:tty5
  • 3
4 Comments
 
LVL 65

Accepted Solution

by:
rockiroads earned 500 total points
ID: 24117425
if its long integer, it will not hold decimals. have you tried double instead?
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 24117434
there is also decimal type

Im confused also by your comment, I need to show the zero on the end. What do u mean by that?
0
 

Author Comment

by:tty5
ID: 24119012
Ah ha!  Changing the Field Size to Double seems to be doing the trick.  I'll make the changes throughout and post after I've run through them all.

The comment about the zeros was simply that the end users use all 3 decimal places for identifying the item, so I ultimately need to show all 3 decimal places with values even if was a 0 and not have the zero truncated if it was on the end of the data.
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 24119186
I see what u mean.  You can specify number of decimal places and format so give that a go now that you got the right datatype.
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question