Nested Loop

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Goldie

    #1

    Nested Loop

    Can anyone offer advice on how to do a nested loop with vb

    I need the loop nested in the main loop to be passed a variable from
    the parent loop for SQL purposes.

    eg:
    parent selects all customer_id's and other information

    child loop needs the customer_id to do SELECT * FROM table WHERE
    customer_id = '@from_parent_l oop'


    I hope this makes sense, and i'm sure it's pretty simple, but my mind
    is fogged at the moment

  • Chris Dunaway

    #2
    Re: Nested Loop

    Goldie wrote:
    Can anyone offer advice on how to do a nested loop with vb
    >
    I need the loop nested in the main loop to be passed a variable from
    the parent loop for SQL purposes.
    >
    Perhaps a For Each?

    For Each id As Integer In Container
    'Use the id here in the SELECT query
    Next

    Comment

    Working...