Results 1 to 3 of 3
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Why error conflict with clausole DISTINCT...

    SQL = "SELECT DISTINCT TIPO_MERCATO FROM RIEPILOGO WHERE LEFT(TIPO_MERCATO,4)='" & Left(Me.COMBO_AREA, 4) & "' AND SITUAZ_AL='" & Me.COMBO_DATE & "' ORDER BY VAL(MID(TIPO_MERCATO,6,8))"

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    SELECT DISTINCT already sorts the records by the fields that you specify. You could store the SELECT DISTINCT query and create a new query based on it that sorts by the desired expression. Or use a Totals query instead:

    SQL = "SELECT TIPO_MERCATO FROM RIEPILOGO WHERE LEFT(TIPO_MERCATO,4)='" & Left(Me.COMBO_AREA, 4) & "' AND SITUAZ_AL='" & Me.COMBO_DATE & "' GROUP BY TIPO_MERCATO ORDER BY VAL(MID(TIPO_MERCATO,6,8))"

  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='770819' date='16-Apr-2009 16:33']SELECT DISTINCT already sorts the records by the fields that you specify. You could store the SELECT DISTINCT query and create a new query based on it that sorts by the desired expression. Or use a Totals query instead:

    SQL = "SELECT TIPO_MERCATO FROM RIEPILOGO WHERE LEFT(TIPO_MERCATO,4)='" & Left(Me.COMBO_AREA, 4) & "' AND SITUAZ_AL='" & Me.COMBO_DATE & "' GROUP BY TIPO_MERCATO ORDER BY VAL(MID(TIPO_MERCATO,6,8))"[/quote]

    NO WORDS!!!!
    work fine!
    Tks.

Posting Permissions

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