Results 1 to 2 of 2

Thread: SQL joins ;P problems

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 2003
    Posts
    81

    SQL joins ;P problems

    I would like to select all medicines some have the 'MMAP' property and some dont. If a medicine has the MMAP property then the medicines product code will apear in the MMAP table.

    there are also other properties like MMAP which the medicine may have but located in different tables....

    my current statement brings up nothing...

    rsProductList.Open "SELECT med.[Product Name] & ' ' & med.
    [Presentation Code] & ' ' & med.Dosage & ' ' & med.[Dosage
    Description] & ' ' & med.Volume & ' ' & med.[Volume Description] AS ProductInfo, med.[Nappi Code - First Six Digits] & med.[Nappi
    Suffix - Last Three Digits] AS NappiCode, man.[Manufacturer
    Name], med.*, mmap.[MMAP pack price exl vat] FROM MED007
    med LEFT JOIN Mma007 mmap ON mmap.[Medprax product code] = med.[Unique Medprax Product Code], Mnf002 man WHERE med.
    [Manufacturer Code] = man.[Manufacturer Code] ORDER BY med.
    [Product Name]", gconnMedAidBrowser, adOpenKeyset,
    adLockOptimistic

    is there a problem with my join.

    i havent really done joins before.

    in the end i would like a list of all the medicines and for each the MMAP column may or may not contain a value
    ----------------------------------------
    ÖÖ two hungry cookie monsters

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Nov 2003
    Posts
    81

    fixed :)

    i used ms access to create a query and used my query

    it went like this

    SELECT DISTINCT MED007.[Unique Medprax Product Code],
    MED007.*, MED007.[Product Name] & ' ' & MED007.[Presentation Code] & ' ' & MED007.Dosage & ' ' & MED007.[Dosage Description]
    & ' ' & MED007.Volume & ' ' & MED007.[Volume Description] AS
    ProductInfo, MED007.[Nappi Code - First Six Digits] & MED007.
    [Nappi Suffix - Last Three Digits] AS NappiCode, MNF002.
    [Manufacturer Name], MMA007.[MMAP pack price exl vat], EXC002.
    [Exclusion code], MPL007.[MPL pack price ex vat]
    FROM (((MED007 LEFT JOIN MNF002 ON MED007.[Manufacturer
    Code] = MNF002.[Manufacturer Code]) LEFT JOIN MMA007 ON
    MED007.[Unique Medprax Product Code] = MMA007.[Medprax product code]) LEFT JOIN EXC002 ON MED007.[Unique Medprax
    Product Code] = EXC002.[Medprax product code]) LEFT JOIN
    MPL007 ON MED007.[Unique Medprax Product Code] = MPL007.
    [Medprax product code];
    ----------------------------------------
    ÖÖ two hungry cookie monsters

Posting Permissions

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



Click Here to Expand Forum to Full Width