Results 1 to 3 of 3

Thread: query

  1. #1
    extacy Guest

    Default query

    let u have a tabLe with a numeric field "idx"<BR><BR>it follows the sequence 1,2,3,4 until 3000<BR><BR>but within this sequence some values (45,56,78 ...)<BR>dont exist ...<BR><BR>i would like to get these values with an sQL query<BR><BR>how can i manage this <BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: query

    Perhaps you could create a loop that contains a counter (set to one outside the loop to start)..<BR><BR>within the loop you could select the field idx from your table where id=count and then you could check if the value returned is the same as count.<BR><BR>At the end of each loop you would store the value of count if it does not equal the value returned by the SQL query (these are the values you are looking for). You would then increment count by one.<BR><BR>Hope that helps,<BR>Ross

  3. #3
    Reggie Guest

    Default RE: query

    %<BR>myCounter=1<BR>Set RS = MyConn.execute("SELECT idx FROM yourTable")<BR><BR>WHILE NOT RS.EOF<BR> if RS("idx")&#060;&#062;myCounter then<BR> response.write myCounter<BR> else<BR> RS.movenext<BR> end if<BR>counter=counter+1<BR>WEND<BR>%&#062;<BR><BR> Instead of just printing out the value of myCounter, you can of course enter it into an array or do whatever you want with it.

Posting Permissions

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