Results 1 to 3 of 3

Thread: To check range of data

  1. #1
    Join Date
    Jun 2005

    To check range of data

    Hi Guys,
    Need your help on this problem.
    Let say table name call tbl_range and 2 field call No1 and No2
    I have this set of record :-
    No1 No2
    1000 2000
    2001 3000
    5000 6000

    My problem, i want to check if user insert another set no No1 : 1500 No2 : 2500. So, this means that range already clash with another range. If this happened it will return 2 record (1000 - 2000) and (2001 - 3000). Can it be done and how?


  2. #2
    Join Date
    Aug 2005
    The Garden State
    you would have to do a join on the two tables where you compare that each No1, No2 fall inside of an existing No1, No2 that is not themselves.
    Acceptable Use | SQL Forum FAQ | celery is tasteless | twitter

    celery is tasteless - currently needing some UI time

  3. #3
    Join Date
    Jun 2005
    Thx chazzy
    Anyway, I already solve the problem using between. Here my code

    Select No1, No2
    From table
    Where (#varNo1# between NO1 and NO2)

    Then in RecordCount eq 0, I proceed to insert the new record.

    Really thx for your reply. Thx chazzy


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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

Recent Articles