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

    Error sintyax in selct distinct (6.0)

    Please correct the sql query, have sintyax error...

    SSQL = "SELECT DISTINCT (MERCATO), FROM TABELLA_SETT ORDER BY (MERCATO)"
    RST2.Open SSQL, CNN, adOpenKeyset, adLockPessimistic, adCmdTable

  2. #2
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Error sintyax in selct distinct (6.0)

    Have you tried just:
    <code>SSQL = "SELECT DISTINCT MERCATO FROM TABELLA_SETT ORDER BY MERCATO"</code>
    Regards,
    Rory

    Microsoft MVP - Excel

  3. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Error sintyax in selct distinct (6.0)

    You should never have a comma as the last character before FROM or WHERE or ORDER BY. In your SELECT clause, the comma can only appear between fields.

    (To be more formal, that last word should be "columns")

Posting Permissions

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