Solved

MS Access sort problem

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

867 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

21 Experts available now in Live!

Get 1:1 Help Now