Home > Software engineering >  Consult MSFlexGrid grid data scheduling problems
Consult MSFlexGrid grid data scheduling problems

Time:10-04

Access database tm_form table has a list of strings pos, similar to the following:
A1 - A1-1, 2, A1-10, A1-3, A1-21, B1, B2-11

Use the order by pos get the following results:,
A1-1
A1-10
A1-2
A1-21
A1-3
B1-3
B2-11

Hope to get the result: in the grid are shown as
A1-1
A1-2
A1-3
A1-10
A1-21
B1-3
B2-11

A great god, please help, shows the code statement, thank you

CodePudding user response:

Because this is a string, so can only be sorted by character.

So I can't achieve the result that you requested.

The only way is to improve the data format, such as A1 A1-1-2 data is changed to: A1-01 A1-02

CodePudding user response:

Of course, if you want to "hard", scoring tear open string, the spin-off for A1 A1-1-1, A1, 1 three fields, and then sorted by A1 and 1 two fields, the output this column A1-1, see is very troublesome

CodePudding user response:

Thank you, keep trying

CodePudding user response:

The order by the Left (pos, 2), CInt (Mid (pos, 3))

CodePudding user response:

Change:
The order by the Left (pos, 2), CInt (Mid (pos, 4))
  • Related