Results 1 to 4 of 4
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I have this sql and i want to ordering rset by PROVA2 but the sort order not work... because i have set PROVA2 text (5 character lenght)...
    POssible to order similiar PROVA2 is number????
    in PROVA" i can have:
    4500
    0501
    4508
    6500
    ....

    strSQL1 = "SELECT PROVA2,PROVA1,PROVA3,PROVA9,PROVA11,PROVA15,PROVA1 7,PROVA13,PROVA14,PROVA18 FROM DATI WHERE PROVA20 = '" & Left(Me.COMBO_MERCATO.Text, 8) & "' AND LEFT(PROVA22,2)='SI' AND PROVA18 BETWEEN " & DA_GG_G & " AND " & A_GG_G & " AND PROVA13 BETWEEN " & IMPDA & " AND " & IMPA & " ORDER BY PROVA2"

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Try

    ... & " ORDER BY Val(PROVA2)"

    (This will fail if there are blank values in the PROVA2 field)

  3. #3
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='HansV' post='769795' date='08-Apr-2009 21:55']Try

    ... & " ORDER BY Val(PROVA2)"

    (This will fail if there are blank values in the PROVA2 field)[/quote]

    ok...
    wath you think about:

    ...int(PROVA2)

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    That should work as well.

Posting Permissions

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