Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by Cpreston

  1. Cpreston

    division by zero

    Hi I have a report that as been working fine until today. I am getting the below when running the report. I presumed someone had entered bad figures somewhere in the files but cannot find anything. Is there anything in the syntax I can put in that will allow the zero in the calculation. I...
  2. Cpreston

    Group results into one row

    No problem, it is probably my bad View which as caused this. I will step back a bit and try and get the base figures working first, then probably apply your Pivot in some way in the end. Thanks for the patience with this and assistance.
  3. Cpreston

    Group results into one row

    Ok thanks for your help and assistance many thanks
  4. Cpreston

    Group results into one row

    Running that I get this result All packs relate to the ProductCode And the View as this query SELECT dbo.Product.ProductCode, dbo.ProductPackDetail.Length, COUNT(dbo.ProductPack.PackID) AS Packs, dbo.ProductPack.PackStatus, dbo.Product.Deleted FROM dbo.ProductPackDetail...
  5. Cpreston

    Group results into one row

    You have missed a 14 between 9 and 6 which then gives 70
  6. Cpreston

    Group results into one row

    Hi Chris Firstly thank you for your patience and help. I get a result now but it is the same result as we had before it is summing if the pact status as more than one length, I am not interested in the Pack inofrmation but just the sum of each length. Below is a snap shot of our Pack screen...
  7. Cpreston

    Group results into one row

    Yes looks like STRIN_AGG is simpler. Mmm I am getting this now Msg 105, Level 15, State 1, Line 6 Unclosed quotation mark after the character string '5.100000)
  8. Cpreston

    Group results into one row

    blimey this is getting a bit to difficult for me, I will google XML PATH query to create the list of lengths Thanks
  9. Cpreston

    Group results into one row

    Thanks Chris, I ran the query and I am getting 'STRING_AGG' is not a recognized built-in function name. I am on Microsoft SQL Server 2016 so I think the 'STRING_AGG' came in on later versions, any ideas what it was before? Thanks
  10. Cpreston

    Group results into one row

    Chris if you are referring to this Select Top 10 * From dbo.[148-vwproductfreefeedCP] Order By ProductCode I get the result
  11. Cpreston

    Group results into one row

    Hi Chriss What query do you want me to run please, sorry I am getting slightly confused with all the replies. I will run it immediately. Thanks
  12. Cpreston

    Group results into one row

    Hi Sorry to have caused any confusion, there are more lengths than I first understood of the situation, however even if I break it down to the original post for this ,SUM([3.0]) AS [3.0] I still get a result of 2 and not 1. I was asked for more information which is what I tried to do. Not...
  13. Cpreston

    Group results into one row

    Hi Ok close but I encountered another issue when looking at the results The 148-vwproductfreeCP View feeds off the below query which is called 148-vwproductfreefeedCP SELECT dbo.Product.ProductCode, dbo.ProductPackDetail.Length, COUNT(dbo.ProductPack.PackID) AS Packs...
  14. Cpreston

    Group results into one row

    Wow thanks for the replies I will give them a try and get back, but huge thanks for the replies.
  15. Cpreston

    Group results into one row

    Hi I have a query that I want to display all results into one row The query currently returns the following But I want it to display the figures in one row for Status as Free and one row as Status Allocated with the Total being the total of all the row. I have tried group by and other...

Part and Inventory Search

Back
Top