MSAC2K: Sort by 4th, 5th, and 6th characters from start of field

  • Thread starter David Dubroff of Mr. PC
  • Start date
D

David Dubroff of Mr. PC

Microsoft Access 2000:

I have a table with car parts information.

Based on the 4th character or number from the start of the part number
field, I would like to sort the records for a report and possibly a form.

How would I go about sorting the records based on the 4th, 5th and 6th
characters or digits in the part number field?

Also, if the 4th character is a 1 (number one) then I would like to display
"100" as a section heading before the start of the data in the 100 section
of the sort.

How do I accomplish my sorting and grouping around the 4th, 5th and 6th
character positions of a field to perform the necessary sort and also
display the correct even hundred numbers as section headings?

For example: a part number might be: PNA145890
This part number would appear in the 100's section of the report since the
fourth character is a number 1.
I want to display 100's, 200's, 300's, 400's.....900's on my report with the
correct data after each heading.

Please advise.....
Dave
 
M

Marshall Barton

David said:
Microsoft Access 2000:

I have a table with car parts information.

Based on the 4th character or number from the start of the part number
field, I would like to sort the records for a report and possibly a form.

How would I go about sorting the records based on the 4th, 5th and 6th
characters or digits in the part number field?

Also, if the 4th character is a 1 (number one) then I would like to display
"100" as a section heading before the start of the data in the 100 section
of the sort.

How do I accomplish my sorting and grouping around the 4th, 5th and 6th
character positions of a field to perform the necessary sort and also
display the correct even hundred numbers as section headings?

For example: a part number might be: PNA145890
This part number would appear in the 100's section of the report since the
fourth character is a number 1.
I want to display 100's, 200's, 300's, 400's.....900's on my report with the
correct data after each heading.


Set the top level in Sorting and Grouping to
=CInt(Mid([PartNum], 4, 1))

and set the second level to
=CInt(Mid([PartNum], 4, 3))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top