Results 1 to 2 of 2

Thread: Maybe another simple database question?

  1. #1

    Thread Starter
    Member
    Join Date
    May 2001
    Location
    New Zealand
    Posts
    40

    Maybe another simple database question?

    Rs.Open "SELECT * FROM Data WHERE Dia = '" & FindDia & "' and Hei = '" & FindHei & "'", Cn


    In the above example how would i modify this so instead of finding the data where " Dia=FindDia" i want it to be able to go say 1 either side.

    Example if FindDia was equal to 9 i want it to search for all data that was either 10 , 9 or 8...

  2. #2
    Hyperactive Member Ed Lampman's Avatar
    Join Date
    Mar 2001
    Posts
    273
    FindDia = 9
    FindDia1=FindDia-1
    FindDia2 = FindDia+1

    Rs.Open "SELECT * FROM Data WHERE (Dia = '" & FindDia &
    "' or Dia = "' & FindDia1 & "' or Dia = '" & FindDia2 & ") and Hei = '" & FindHei & "'", Cn

Posting Permissions

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



Click Here to Expand Forum to Full Width