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.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • 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 1 month, 2 weeks ago by  Phil Parkin.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • The column should be called profit.

    Thanks

  • OK. Try this

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

     

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

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

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