?
Solved

MS Access sort problem

Posted on 2009-04-10
4
Medium Priority
?
307 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 2000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

850 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