Results 1 to 2 of 2

Thread: How do I loop thru the rows that a returned from stored Procedure?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2006
    Posts
    137

    How do I loop thru the rows that a returned from stored Procedure?

    I have a stored procedure that returns a bunch of rows in one column like the following example:

    ID
    A
    B
    C
    D
    E

    Now, in the report, i have the following layout

    _A _B _C _D _E

    i want to loop thru the stored procedure results and determine if a letter exists in the results. If the letter exists, i would like to mark the correct character. For example, if A and C exists, the report would look like this:

    XA _B XC _D _E

    I'm using formula fields but its only reading the first row. How do check each row in the results?

    Code:
     if  {USP...} = "A" then
    "X"

  2. #2
    Lively Member
    Join Date
    Sep 2007
    Location
    Texas
    Posts
    98

    Re: How do I loop thru the rows that a returned from stored Procedure?

    Can i suggest the following depending on the Database you are using?

    If you are using Access then use a Crosstab query
    If you are using SQL Server then use a Cursor to go thru your results.

    Hope this helps
    Working in VB2005 and SQL2005

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width