Skip to main content
December 23, 2011
Question

how do i retrieve a value from a specific row and column of a query?

  • December 23, 2011
  • 1 reply
  • 654 views

I'm new at this, but i want to be able to retrive values from succeeding rows while i'm outputting results from a query. the table in the datasource is a program schedule, each row represents one hour of weekly programming, and i want to be able to look ahead to see when the next program starts. can i grab values from a designated row and column of a table or query?

    This topic has been closed for replies.

    1 reply

    12Robots
    Participating Frequently
    December 23, 2011

    I think what you are looking for is something like this.

    <cfset nextStartTime = queryName["startTimeColumnName"][currentrow+1] />

    You can access queries like multimensional arrays, so I am telling it to get me the startTimeCoulmnName value from the next record.

    Jason

    December 23, 2011

    OK. Thank you for that. I think that solves my problem. I have to check each succeeding row to see when the program changes, which could take several rows, because programs can last hours. So the nextstarttime could be several rows ahead. Thanks again.