#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2013
    Posts
    1
    Rep Power
    0

    Looping through access datatables and compare values to get conflicting data


    i have a table in access containing data like:

    PaperID--School--PaperID---PaperTitle--Noofstudents---Duration---ListofModules
    paper 1---SEG----EG1832---Mechanics---- 286----1.5(hrs)---EG1832
    paper 2---SEG----EG1833---ElectricalPrinc--375--1.5 -------EG1833 EG1952 EG1903
    another table with:

    module students
    EG1832 ----- 111411H
    -blank ----- 111380Y
    -blank ---- 151621H
    EG1952 ----- 198653H
    -blank ----- 545411Q
    - blank ---- 111411H
    if let say student;111411h is taking EG1832 and EG1952, then output:

    Conflict modules No.ofstudents student(adminNo)
    paper1 aper2 1 111411H
    anyone tell me how to go about doing this?

    thanks in advance!
    any help will be greatly appreciated!
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2009
    Posts
    151
    Rep Power
    6
    What is the rule of conflict in this case?
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2008
    Posts
    30
    Rep Power
    7
    I'm not sure exactly what you are trying to do, but are you wanting to compare something a user enters to a value in your database?

    Code:
    Dim Count As Integer = 0 
    
    Dim str_SQL = "SELECT Count(*) FROM tbl_Name WHERE value = @valueToCompare "
    
    Count = value from strSql 
    
    If Count > 1 Then 
    
    conflict 
    
    Else
    
    No Conflict
    
    End If

IMN logo majestic logo threadwatch logo seochat tools logo