Syntax Problem

  • I think that I am almost there but I am getting one red squiggle under the

    ((100.00

    on Line 5

    SELECT SalesLT.Product.Name

    ,SalesLT.Product.Color

    ,SalesLT.Product.StandardCost

    ,SalesLT.Product.ListPrice

    ,(CONCAT('£'CAST ((100.00,'C', 'en-gb'))AS CurrencyFormat)'SalesLT.Product.ListPrice - SalesLT.Product.StandardCost AS Profit')

    ,SalesLT.ProductModel.Name AS SubCatNameType

    ,SalesLT.Product.ListPrice,SalesLT.Product.Name AS SubCatName

    FROM SalesLT.Product INNER JOIN

    SalesLT.ProductModel ON SalesLT.ProductModel.ProductModelID = SalesLT.ProductModel.ProductModelID

     

    Many thanks

  • (CONCAT('£'CAST ((100.00,'C', 'en-gb'))AS CurrencyFormat)'SalesLT.Product.ListPrice - SalesLT.Product.StandardCost AS Profit')

    Is this supposed to be one column or two? What are you trying to do here? It's not clear.


  • It should be on column.

     

  • OK, here is my second question, once again, this time in black and white.

    What should the column should be called and what calculation is required?

    The existing syntax is nonsensical.

    • This reply was modified 11 months, 3 weeks ago by  Phil Parkin.

  • The column should be called profit.

    Thanks

  • OK. Try this

    (SalesLT.Product.ListPrice - SalesLT.Product.StandardCost) AS Profit

     


Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply