Solved

MS Access sort problem

Posted on 2009-04-10
4
296 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
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…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

708 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now