Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Access (https://www.askmehelpdesk.com/forumdisplay.php?f=441)
-   -   Error on Access 2007: "This expression is typed incorrectly, or it is too comple (https://www.askmehelpdesk.com/showthread.php?t=786660)

  • Mar 12, 2014, 09:36 AM
    vision1
    Error on Access 2007: "This expression is typed incorrectly, or it is too comple
    Hi guys,

    I get an error on Access 2007: "This expression is typed incorrectly, or it is too complex to be evaluated. For example, a numeric expression may contain too many complicated elements. Try simplifying the expression by assigning parts of the expression to variables"

    This is the code:
    SELECT DISTINCTROW Sales.SalesDate, Products.ManufacturerID, Products.Colour, Products.Model, Products.Size, Sum(CLng([Sales Details].Quantity*[Sales Details].UnitPrice*(100-[Sales Details].Discount))/100) AS [Total Sales], Sum([Sales Details].Quantity) AS [Total Units]
    FROM Products INNER JOIN ([Frame Control] INNER JOIN (Sales INNER JOIN [Sales Details] ON Sales.SalesID = [Sales Details].SalesID) ON [Frame Control].SIID = [Sales Details].SIID) ON Products.ProductID = [Frame Control].ProductID
    WHERE (((Sales.SalesDate)>=[forms]![Report Date Range]![Beginning Order Date] And (Sales.SalesDate)<=[forms]![Report Date Range]![Ending Order Date]))
    GROUP BY Sales.SalesDate, Products.ManufacturerID, Products.Colour, Products.Model, Products.Size;

    Its really strange how it used to work before. Any ideas to resolve this would be grateful!

    Thanks
  • Mar 12, 2014, 09:57 AM
    ScottGem
    I would try copy and pasting the SQL statement into SQL view of Query Design Mode then try switching to Design view. This is likely to give you a clear indication of what is wrong.

    I'm guessing the problem is here:
    FROM Products INNER JOIN ([Frame Control] INNER JOIN

    A join has to be expressed as tablename.Fieldname = tablename.Fieldname

    [Frame Control] is left hanging out in nowhere.

  • All times are GMT -7. The time now is 02:01 PM.