Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2004
    Posts
    10

    Unanswered: Problem in sorting text field - please help

    Hi access gurus,

    I have a table named import data which contains the field called section_size which is of variable type text in access but when i sort it in asc order the data is not sorted properly for eg i have data as following in that field :-

    L 100X10
    L 100X11
    L 100X9
    L 45X8
    L 45X9
    L 50X9

    WHEN I SORT THE RESULT IS

    L 100X9
    L 100X10
    L 100X11
    L 45X8
    L 45X9
    L 50X9

    BUT THE RESULT WHT I WANT IN MY OUTPUT IS

    L 45X8
    L 45X9
    L 50X9
    L 100X9
    L 100X10
    L 100X11

    Please help me in this as i m facing problem with this .

    Best Regards

    Arif

  2. #2
    Join Date
    Jan 2004
    Location
    Aberdeen, Scotland
    Posts
    1,067
    Heres a bit of SQL that could Help

    Code:
    SELECT *
    FROM tbltest
    ORDER BY CInt(Mid$([A],1,InStr(1,[A],"X")-1)), CInt(Mid$([A],InStr(1,[A],"X")+1,Len(A)-InStr(1,[A],"X")+1)) ;
    HTH
    Dave

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •