Results 1 to 4 of 4
  1. #1
    yrstruly is offline Competent Performer
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2024
    Posts
    122

    Join Expression Not Supported - ERROR

    I have two codes that i would like to join to get a total. Below code does the calculation correctly:


    Code:
    SELECT     N.OrderID,
        N.DeliveryNo,
        N.PlantIDScion,
        N.PlantIDRoot,
        N.TreePrice,
        N.DeliveryQuantity,
        N.sRL2Pay,
        N.rRL2Pay,
        Round(N.TreePrice + IIf(N.sRL2Pay, 1, 0) + IIf(N.rRL2Pay, N.TreePrice * 0.20, 0), 2) AS FinalPricePerTree,
        Round(N.DeliveryQuantity * (N.TreePrice + IIf(N.sRL2Pay, 1, 0) + IIf(N.rRL2Pay, N.TreePrice * 0.20, 0)), 2) AS TotalLinePrice,
        "R" & Format(N.TreePrice, '0.00') 
            & " + sR" & Format(IIf(N.sRL2Pay, 1, 0), '0.00') & " R" 
            & " + r%" & Format(IIf(N.rRL2Pay, 20, 0), '0.00') & ", L" AS FullBreakdown
    FROM 
        TblNursOrders AS N
    WHERE 
        N.DeliveryNo IS NOT NULL;
    Sample data:
    Code:
    OrderID    DeliveryNo    PlantIDScion    PlantIDRoot    TreePrice    DeliveryQuantity    sRL2Pay    rRL2Pay    FinalPricePerTree    TotalLinePrice    FullBreakdown
    0    INV-2514    AP0572    AP0388    128,00    530    Yes    Yes    154,6    81938    R128,00 + sR1,00 R + r%20,00, L
    FinalPrice columns needs to be in code below:
    HTML Code:
    SELECT    N.OrderID,    N.DeliveryNo,    N.PlantIDScion,    N.PlantIDRoot,    SP.PlantType       AS Fruit,    N.OrderSize,    PR.SizeFactor,    N.TreePrice,    N.DeliveryQuantity,    N.sRL2Pay,    N.rRL2Pay,    Round(      (N.TreePrice * Nz(PR.SizeFactor,1.0))      + IIf(N.sRL2Pay, Nz(PR.SurchargePerTree,0),0)      + IIf(N.rRL2Pay, N.TreePrice * Nz(PR.RootLevyPct,0)/100,0)    ,2)                 AS FinalPricePerTree,    Round(      N.DeliveryQuantity      * (          (N.TreePrice * Nz(PR.SizeFactor,1.0))        + IIf(N.sRL2Pay, Nz(PR.SurchargePerTree,0),0)        + IIf(N.rRL2Pay, N.TreePrice * Nz(PR.RootLevyPct,0)/100,0)      )    ,2)                 AS TotalLinePrice,    "R" & Format(N.TreePrice * Nz(PR.SizeFactor,1.0),'0.00')      & " + sR" & Format(IIf(N.sRL2Pay, Nz(PR.SurchargePerTree,0),0),'0.00')      & " + r%" & Format(IIf(N.rRL2Pay, Nz(PR.RootLevyPct,0),0),'0.00')                        AS FullBreakdownFROM    (      (        TblNursOrders AS N        INNER JOIN Plants AS SP          ON N.PlantIDScion = SP.PlantID      )      INNER JOIN Plants AS RP        ON N.PlantIDRoot = RP.PlantID    )    LEFT JOIN TblPriceRules AS PR      ON (SP.PlantType = PR.Fruit)     AND (N.OrderSize BETWEEN PR.MinSize AND PR.MaxSize)WHERE    N.DeliveryNo IS NOT NULLORDER BY    SP.PlantType,    N.OrderSize,    N.DeliveryQuantity DESC;I get the join expression not supported error
    Sample data
    Code:
    Nr	Fruit	OrderDate	SCult	SClone	SSource	SCert	RCult	RClone	RSource	RCert	Agent	OrderAmount	Allocated	Nursery	OrderBy	Gebied	sRL2Pay	rRL2Pay	TreePrice	Select	Comment	OrderSize	CertifiedType	DeliveryNo	DeliveryDate	DeliveryQuantity	DeliveryType	PayableTo	Anno	sRoyLev	rRoyLev
    3349	Appel	26/01/2024	Bingo Gala	BI 1701			G.778	CB 17			Topfruit GV - Buccleuch	6 000,00	40	Redhill Superplant Nursery (Pty) Ltd	Leon	Irene	-1	-1	R126,00	0	R126,00 + sR0,00 R + r%20 R			DN059	06/08/2024	40		Sonja Lucas t/a Ruby Boerdery	24	sR0,00 R	r%20 R

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,927
    I don't see any joins in your query, there is just one table

  3. #3
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,421
    there is a join statement in that too long sql (3rd box from top). I only looked to help you help as normally, posted sql like that is not something I want to try to read, let alone try to make sense of.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 11 Access 2021
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Using HTML code tags messed up the SQL post. Edit your post to fix.

    Did you build query in SQL View? It includes a non-standard join which I don't think can be done in Design View. Maybe AND (N.OrderSize BETWEEN PR.MinSize AND PR.MaxSize) should be in WHERE clause.

    Use table builder to post data. Or even copy/paste from Access table.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 10
    Last Post: 11-20-2018, 11:49 PM
  2. Replies: 3
    Last Post: 09-20-2017, 09:50 AM
  3. Replies: 6
    Last Post: 10-19-2016, 03:40 AM
  4. Help with Error: Join Expression Not Supported
    By gammaman in forum Queries
    Replies: 1
    Last Post: 07-30-2013, 02:08 PM
  5. Join Expression Not Supported
    By ubsman in forum Queries
    Replies: 3
    Last Post: 04-30-2009, 08:36 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums