locked
Query RRS feed

  • Question

  • User1979860870 posted

    Hi

      I have below query , I also want Date of A1.Ordno from table 2 where table 2 Ordno = A1.OrdNo

    STUFF((Select Distinct + ', '+ A1.Ordno
    from Test A1
    where A1.No ={?No@}
    FOR XML PATH('')),1,1,'') as SalesRef

    Secondly i want to add S- to A1.Ordno

    Thanks

    Saturday, September 26, 2020 4:21 PM

Answers

  • User-939850651 posted

    Hi jagit saini,

    jagjit saini

    I also want Date of A1.Ordno from table 2 where table 2 Ordno = A1.OrdNo

    I don't understand what this means, where table 2 refers to the Test table in your query?

    In addition, if you want to add the'S-' character in front of the field, you could try this:

    select STUFF((Select Distinct + ',S-'+ A1.Ordno
    from Test A1
    where A1.No ={?No@}
    FOR XML PATH('')),1,1,'') as SalesRef

    If I misunderstood something, could you provide more details?

    Best regards,

    Xudong Peng

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, September 28, 2020 6:27 AM