Professional Web Applications Themes

comparing queries to flag conflicts - ASP Database

Hello all... I'm stuck, I cannot figure out how I should go about flagging conflicts on a sheduling app. I currently have 8 columns (school grades) that have class over the course of 9 periods. I am populating the asp page fine, and making changes to the database with forms lists. I need to compare all the results of one period (thats 8 results) so that i may find a classroom conflict. Is there any solution in SQL? This is my query: sql = "SELECT * FROM schedule WHERE period ='"&num&"'" I step through this 9 times in a for/next ...

  1. #1

    Default comparing queries to flag conflicts

    Hello all... I'm stuck, I cannot figure out how I should go about flagging
    conflicts on a sheduling app. I currently have 8 columns (school grades)
    that have class over the course of 9 periods. I am populating the asp page
    fine, and making changes to the database with forms lists. I need to compare
    all the results of one period (thats 8 results) so that i may find a
    classroom conflict. Is there any solution in SQL?

    This is my query:
    sql = "SELECT * FROM schedule WHERE period ='"&num&"'"
    I step through this 9 times in a for/next loop

    Thanks in advance!
    Alpay Eno



    Alpay Eno Guest

  2. #2

    Default Re: comparing queries to flag conflicts

    Disclaimer: I'm not a master querier.

    Using this sample data:


    id period classname
    1 1 Math
    2 2 History
    3 3 German
    4 4 French
    5 5 Calculus
    6 6 Physics
    7 7 Lunch
    8 8 Gym
    9 3 English
    10 5 Social Studis

    you can see that period 3 has German and English, and period 5 has Calculus
    and Social Studis[sic]. So, to find that conflict, something like this will
    work:

    SELECT A.Period,A.Classname FROM Classes AS A
    INNER JOIN CLASSES AS B ON A.Period=B.Period
    WHERE A.ID <> B.ID ORDER BY A.Period

    That will join the table to itself matching up by period and then return the
    ones with the same period. So, the result would be:

    3 English
    3 German
    5 Social Studis
    5 Calculus

    Ray at home

    --
    Will trade ASP help for SQL Server help


    "Alpay Eno" <enospamsux.com> wrote in message
    news:D7iUa.145526$ye5.25557989news4.srv.hcvlny.cv .net...
    > Hello all... I'm stuck, I cannot figure out how I should go about flagging
    > conflicts on a sheduling app. I currently have 8 columns (school grades)
    > that have class over the course of 9 periods. I am populating the asp page
    > fine, and making changes to the database with forms lists. I need to
    compare
    > all the results of one period (thats 8 results) so that i may find a
    > classroom conflict. Is there any solution in SQL?
    >
    > This is my query:
    > sql = "SELECT * FROM schedule WHERE period ='"&num&"'"
    > I step through this 9 times in a for/next loop
    >
    > Thanks in advance!
    > Alpay Eno
    >
    >
    >


    Ray at Guest

Similar Threads

  1. Conflicts or Known bad ones?
    By Jefferis NoSpamme in forum Macromedia Exchange Dreamweaver Extensions
    Replies: 1
    Last Post: May 10th, 04:34 AM
  2. Queries Of Queries Single Quote Problem
    By TimH2O in forum Macromedia ColdFusion
    Replies: 0
    Last Post: April 1st, 07:46 PM
  3. conflicts with the name of another class
    By larsgjo webforumsuser@macromedia.com in forum Macromedia Flash Actionscript
    Replies: 0
    Last Post: January 20th, 06:17 PM
  4. XP conflicts on NT Network
    By Robert Moir in forum Windows Networking
    Replies: 1
    Last Post: July 9th, 06:28 PM
  5. Lan adapter conflicts
    By Ida Samuel in forum Windows Networking
    Replies: 1
    Last Post: July 9th, 03:39 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139