2 Replies Latest reply on Apr 21, 2009 11:53 AM by brianism

    How to split query results

    brianism Level 1

      Does anyone if there is a method to split up results of a query based on a specific number to stop and split at?

       

      For example, I want to pull out all of these numbers from my database....say 1 - 20. I want to show them on the page in order, but I would want to stop once I hit a preset number, say 12.5, then continue on.  So I would need a way to show this:

       

      My Numbers:

      1,2,3,4,5,6,7,8,9,10,11,12,.5

      Total equalling 12.5

       

      Numbers after split:

      .5,14,15,16,17,18,19,20

      Total above 12.5

       

      I'm basically adding numbers in my database, but need to cut it off at a certain predetermined point (in this example 12.5) and start the rest after that point.

       

      Right now I'm using coding that tries to split the results from a users input and insert them into the database. I'm running into problems displaying that data correctly though. It seems it would make more sense to just input everything normally, then display everything and spit it there.

       

      Any help in the right direction would be greatly appreciated. I'm stumped on this!