my query in to send parameter function returning a value from a my query in values

  • 173164 | Tomas
    174498 | Hp
    175809 |Lg

    -- return all data all okay not have any problem
    now i want send parameter (DocsNumber) one a function in my function Name fn_KetPrices when KetPrices to me Tax,Discount,Grantotal

    when i want merge to final query i want see
    173164 | Tomas | 18 | 5 | 90
    174498 | Hp | 18 | 5 | 100
    175809 |Lg | 18 | 5 | 50

    how to call it my query in to send parameter function returning a value from a query 

    thank you so much 

  • salih hanifeoglu - Sunday, March 25, 2018 7:18 AM

    173164 | Tomas
    174498 | Hp
    175809 |Lg

    -- return all data all okay not have any problem
    now i want send parameter (DocsNumber) one a function in my function Name fn_KetPrices when KetPrices to me Tax,Discount,Grantotal

    when i want merge to final query i want see
    173164 | Tomas | 18 | 5 | 90
    174498 | Hp | 18 | 5 | 100
    175809 |Lg | 18 | 5 | 50

    how to call it my query in to send parameter function returning a value from a query 

    thank you so much 

    Your question is incomplete, you need to provide DDL and sample data, would be surprised if anyone can give you the expected results from what you have provided.

    ...

  • Hi HappyGeek firstly thank you for help  i m try give to simple sample 
    now have my handle 2 table
    1.TableName = Customers
    select * from Customers
    -- result here
    173164 | Tomas
    174498 | Hp
    175809 |Lg

    2.TableName (Function ) = MyFunction 
    select * from MyFunction(DocsNumbers)
    --return data
    173164 | 10
    174498 | 5
    175809 | 20

    now have my handle 2 data how to merge 1.table and function i want result this for example

    173164 | Tomas | 10
    174498 | Hp | 5
    175809 |Lg | 20

  • Errr... CROSS APPLY to the function will probably be what you're looking for, but I have no real idea because you haven't given enough details.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Thank you @gilamonster i m solved with CROSS APPLY thank you  so much

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

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