locked
loop access columns RRS feed

  • Question

  • User1864573222 posted

    hi, i have a access database containing the following:

    SEG,AMK,101427Y,EG3902,EG3902-G1
    SEG,AMK,101427Y,EGS650,EGS650-G1
    SEG,AMK,103852S,EG3901,EG3901-G1
    SEG,AMK,103852S,EG3904,EG3904-G1
    SEG,AMK,103852S,EGS104,EGS104-G1
    SEG,AMK,103852S,EGS650,EGS650-G1
    SEG,AMK,106581C,EG3901,EG3901-G1
    SEG,AMK,106581C,EG3902,EG3902-G1
    SEG,AMK,111713M,EG3901,EG3901-G1
    SEG,AMK,111713M,EG3902,EG3902-G1

    i wanna loop to get: example, EG3091 - 103852S
                                                            - 106581C
                                                            - 111713M

    Means a list with Distinct Module codes and the students taking the module to come out like the example i listed.

    i have retrieved the distinct module list from my database using SQL command already.

    anyone teach me how should i go about doing it?

    Can i use For loop? if yes, how can i say if the student matches the module?

    Thanks in advance!

    Monday, July 1, 2013 1:19 AM

All replies

  • User-1972223072 posted

    Elaborate your issue, we couldn't understand.

    if you have list of string then write linq query to matching records.

    Tuesday, July 2, 2013 5:26 AM
  • User1864573222 posted

    hi, i have a access database containing the following:

    SEG,AMK,101427Y,EG3902,EG3902-G1
    SEG,AMK,101427Y,EGS650,EGS650-G1
    SEG,AMK,103852S,EG3901,EG3901-G1
    SEG,AMK,103852S,EG3904,EG3904-G1
    SEG,AMK,103852S,EGS104,EGS104-G1
    SEG,AMK,103852S,EGS650,EGS650-G1
    SEG,AMK,106581C,EG3901,EG3901-G1
    SEG,AMK,106581C,EG3902,EG3902-G1
    SEG,AMK,111713M,EG3901,EG3901-G1
    SEG,AMK,111713M,EG3902,EG3902-G1

    i wanna loop to get: example, EG3091 - 103852S
                                                            - 106581C
                                                            - 111713M

    i wanna have the output of the above.

    i know of using WHERE clause to search the database. 

    column headings are as follows: School,Campus,AdminNo,ModuleCode,ModuleGrp

    for a modulecode in column 4, search through column 3 to get the students matching with the modulecode to display and have the output like the above.

    thanks

    Tuesday, July 2, 2013 8:41 PM