Results 1 to 2 of 2

Thread: Tricky?

  1. #1
    Stuart Welch Guest

    Default Tricky?

    I&#039;m 3/4 way through this new site. and I&#039;ve got a query on the front page that lets you search jobs in a database. The form has two things to let you search on: Location - there is a drop down list of 14 UK geographical locations. There is also an &#039;all&#039; location if you are that mobile that you can take a contract anywhere in the country. The SQL statement is currently this, and it works for geographical location search:<BR>SELECT * FROM "vacancy_list Query"<BR>WHERE Job_locator LIKE &#039;::Job_locator::&#039;<BR><BR>However, there is a second search criteria in the same form which is meant to limit the search to jobs posted in the last 1,2,3,4 or 5 days. I&#039;ve got an automatic date stamp in the DB as to when each job was added. Can anyone tell me how to amend the above code to include this part of the filter? At the moment it does nothing, of course, because that code is only picking up the &#039;job locator&#039; part of the form. <BR><BR>If it&#039;s any help, you can see the partially completed site at<BR><BR>Thanks in advance...<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Tricky?

    strdate = request("userselecteddatefield")<BR>strdate = Date - strdate<BR>now the sql<BR>"SELECT * FROM vacancy_list Query WHERE Job_locator LIKE &#039;%" & reqeust("Job_locator") & "%&#039; and searchdate &#062;= &#039;" & strdate & "&#039;"<BR>................<BR>try the above and see if that works.<BR> <BR>

Posting Permissions

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