Text field Sorting in Report

G

Guest

Hello,

I have text field that I would like to sort by ASC in report. Text data
looks like this (P-1,p-2,p-10,p-11,p-3)

I want this field to be sorted (p-1,p-2,p-3,p-10,p-11) but it sorts
(p-1,p-10,p-11,p-2,p-3) in the report. This field is GROUPed & SORTed in the
report. Help & Thanks!
 
G

Guest

You should be able to use an expression in your sorting and group like:
=Val(Mid([unnamedfld],Instr([unnamedfld],"-")+1))
 
M

Marshall Barton

skk said:
I have text field that I would like to sort by ASC in report. Text data
looks like this (P-1,p-2,p-10,p-11,p-3)

I want this field to be sorted (p-1,p-2,p-3,p-10,p-11) but it sorts
(p-1,p-10,p-11,p-2,p-3) in the report. This field is GROUPed & SORTed in the
report. Help & Thanks!


The "P-" part of the dield seems to be totally redundant.
If that's true, then it should not be stored in the field
and the field should be a number instead of text.

If you can not do anything about that, then try setting the
report's Sorting to an expression like:
=Val(Mid(fied, 3))
 
G

Guest

Thank you Marshall & Duane for your response and suggestion. I'll try it
with your advice.
 

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