access accepts the MINUS operator

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • CenturionX

    access accepts the MINUS operator

    Hello everybody i'm trying to use the minus operator like that:
    (SELECT DISTINCT TRIM(S.Lname & ', ' & Fname) AS Name, S.SID
    FROM Salesperson as S,
    Schedule as H
    WHERE S.SID = H.SID
    AND H.Day = 4
    AND H.AM = 0
    AND H.PM = 0
    AND H.Ev = 0)
    MINUS
    (SELECT DISTINCT TRIM(S.Lname & ', ' & Fname) AS Name, S.SID
    FROM Salesperson as S,
    Schedule_Except ions AS E
    WHERE S.SID = E.SID
    AND #2008-02-04# BETWEEN E.IniDate AND E.FinDate
    AND E.Validity = '1')

    Then i get an error that says: Syntax error in union query.

    May somebody helpme. Thanks
  • timmg

    #2
    Re: access accepts the MINUS operator

    Alas, Access does not support anything other that Union.

    Tim Mills-Groninger

    On Feb 7, 10:45 am, CenturionX <darwinbaldr... @gmail.comwrote :
    Hello everybody i'm trying to use the minus operator like that:
    (SELECT DISTINCT TRIM(S.Lname & ', ' & Fname) AS Name, S.SID
    FROM Salesperson as S,
          Schedule as H
    WHERE S.SID = H.SID
      AND H.Day = 4
      AND H.AM = 0
      AND H.PM = 0
      AND H.Ev = 0)
    MINUS
    (SELECT DISTINCT TRIM(S.Lname & ', ' & Fname) AS Name, S.SID
    FROM Salesperson as S,
         Schedule_Except ions AS E
     WHERE S.SID = E.SID
       AND #2008-02-04# BETWEEN E.IniDate AND E.FinDate
       AND E.Validity = '1')
    >
    Then i get an error that says: Syntax error in union query.
    >
    May somebody helpme.  Thanks

    Comment

    • Larry Linson

      #3
      Re: access accepts the MINUS operator

      You can likely do what you want with the NOT IN operator and a Subquery in
      the WHERE clause. Search on Access and Subquery... and you will find a good
      deal of information, some part of which is likely to be pertinent.

      Larry Linson
      Microsoft Office Access MVP

      "CenturionX " <darwinbaldrich @gmail.comwrote in message
      news:f6b05765-4149-47b5-863d-86f829d908b6@d2 1g2000prf.googl egroups.com...
      Hello everybody i'm trying to use the minus operator like that:
      (SELECT DISTINCT TRIM(S.Lname & ', ' & Fname) AS Name, S.SID
      FROM Salesperson as S,
      Schedule as H
      WHERE S.SID = H.SID
      AND H.Day = 4
      AND H.AM = 0
      AND H.PM = 0
      AND H.Ev = 0)
      MINUS
      (SELECT DISTINCT TRIM(S.Lname & ', ' & Fname) AS Name, S.SID
      FROM Salesperson as S,
      Schedule_Except ions AS E
      WHERE S.SID = E.SID
      AND #2008-02-04# BETWEEN E.IniDate AND E.FinDate
      AND E.Validity = '1')
      >
      Then i get an error that says: Syntax error in union query.
      >
      May somebody helpme. Thanks

      Comment

      Working...