Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Old school dbase II / clipper database, multiple left joins

Old school dbase II / clipper database, multiple left joins

Scheduled Pinned Locked Moved Database
databasehelp
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jkirkerx
    wrote on last edited by
    #1

    I've never worked on these old dbase/clipper database files for Account Mate DOS, and I'm having trouble with multiple joins. Says I'm missing a arithmetic operator in the statement. I can't find a reference to study to get an idea of how it should be written. I really don't want to make 2 calls, because it really slows down the load time. This is the error message Syntax error (missing operator) in query expression '(c.FCUSTNO = a.FCUSTNO) LEFT JOIN ARCEM01.dbf e ON (c.FCUSTNO = e.FCUSTNO)'.

    "SELECT c.FINVNO, c.FCUSTNO, c.FCOMPANY, c.FSALESPN, c.FSHIPVIA, c.FORDDATE, c.FSHIPDATE, c.FNTAXAMT, a.FADDR1 " & _
    "FROM ARINV01.dbf c " & _
    "LEFT JOIN ARCUS01.dbf a ON (c.FCUSTNO = a.FCUSTNO) " & _
    "LEFT JOIN ARCEM01.dbf e ON (c.FCUSTNO = e.FCUSTNO) " & _
    "WHERE c.FORDDATE=@startDate"

    J 1 Reply Last reply
    0
    • J jkirkerx

      I've never worked on these old dbase/clipper database files for Account Mate DOS, and I'm having trouble with multiple joins. Says I'm missing a arithmetic operator in the statement. I can't find a reference to study to get an idea of how it should be written. I really don't want to make 2 calls, because it really slows down the load time. This is the error message Syntax error (missing operator) in query expression '(c.FCUSTNO = a.FCUSTNO) LEFT JOIN ARCEM01.dbf e ON (c.FCUSTNO = e.FCUSTNO)'.

      "SELECT c.FINVNO, c.FCUSTNO, c.FCOMPANY, c.FSALESPN, c.FSHIPVIA, c.FORDDATE, c.FSHIPDATE, c.FNTAXAMT, a.FADDR1 " & _
      "FROM ARINV01.dbf c " & _
      "LEFT JOIN ARCUS01.dbf a ON (c.FCUSTNO = a.FCUSTNO) " & _
      "LEFT JOIN ARCEM01.dbf e ON (c.FCUSTNO = e.FCUSTNO) " & _
      "WHERE c.FORDDATE=@startDate"

      J Offline
      J Offline
      Jorgen Andersson
      wrote on last edited by
      #2

      If I remember correctly (which might not be the case) dbase only allows one outer join. But this doesn't seem to be a real problem as you're not using ARCEM01.dbf for anything. The solution otherwise would be to use subqueries in the select. Like this:

      SELECT c.FINVNO
      ,c.FCUSTNO
      ,c.FCOMPANY
      ,c.FSALESPN
      ,c.FSHIPVIA
      ,c.FORDDATE
      ,c.FSHIPDATE
      ,c.FNTAXAMT
      ,(SELECT a.FADDR1 FROM ARCUS01.dbf a WHERE c.FCUSTNO = a.FCUSTNO) as FADDR1
      FROM ARINV01.dbf c
      WHERE c.FORDDATE=@startDate

      Wrong is evil and must be defeated. - Jeff Ello[^]

      J 2 Replies Last reply
      0
      • J Jorgen Andersson

        If I remember correctly (which might not be the case) dbase only allows one outer join. But this doesn't seem to be a real problem as you're not using ARCEM01.dbf for anything. The solution otherwise would be to use subqueries in the select. Like this:

        SELECT c.FINVNO
        ,c.FCUSTNO
        ,c.FCOMPANY
        ,c.FSALESPN
        ,c.FSHIPVIA
        ,c.FORDDATE
        ,c.FSHIPDATE
        ,c.FNTAXAMT
        ,(SELECT a.FADDR1 FROM ARCUS01.dbf a WHERE c.FCUSTNO = a.FCUSTNO) as FADDR1
        FROM ARINV01.dbf c
        WHERE c.FORDDATE=@startDate

        Wrong is evil and must be defeated. - Jeff Ello[^]

        J Offline
        J Offline
        jkirkerx
        wrote on last edited by
        #3

        I kind of thought that. I didn't put the e.FEMAIL1 in for experimenting yet until I got some concrete information on it. Thanks!

        1 Reply Last reply
        0
        • J Jorgen Andersson

          If I remember correctly (which might not be the case) dbase only allows one outer join. But this doesn't seem to be a real problem as you're not using ARCEM01.dbf for anything. The solution otherwise would be to use subqueries in the select. Like this:

          SELECT c.FINVNO
          ,c.FCUSTNO
          ,c.FCOMPANY
          ,c.FSALESPN
          ,c.FSHIPVIA
          ,c.FORDDATE
          ,c.FSHIPDATE
          ,c.FNTAXAMT
          ,(SELECT a.FADDR1 FROM ARCUS01.dbf a WHERE c.FCUSTNO = a.FCUSTNO) as FADDR1
          FROM ARINV01.dbf c
          WHERE c.FORDDATE=@startDate

          Wrong is evil and must be defeated. - Jeff Ello[^]

          J Offline
          J Offline
          jkirkerx
          wrote on last edited by
          #4

          That Works! Thanks Jorgen

          SELECT c.FINVNO
          ,c.FCUSTNO
          ,c.FCOMPANY
          ,c.FSALESPN
          ,c.FSHIPVIA
          ,c.FORDDATE
          ,c.FSHIPDATE
          ,c.FNTAXAMT
          ,(SELECT a.FADDR1 FROM ARCUS01.dbf a WHERE c.FCUSTNO = a.FCUSTNO) AS FADDR1
          ,(SELECT e.FEMAIL1 FROM ARCEM01.dbf e WHERE c.FCUSTNO = e.FCUSTNO) AS FEMAIL1
          FROM ARINV01.dbf c
          WHERE c.FORDDATE=@startDate

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups