How do I?

Results 1 to 2 of 2

Thread: How do I?

  1. #1
    Join Date
    Dec 1969

    Default How do I?

    Hi guys!, several How can I questions.<BR><BR>1) How do I perform a search and allow a user to select "Exclude" the following words when searching. Do I state Not Like?<BR><BR>2) The records stored in the DB all have a date e.g. The date they were inserted. E.g. 12/10/03 (DD/MM/YY). How do I allow a person to search a selection of all records for the past 3/6/12 months which they would have selected from a drop-down menu. <BR><BR>Thanks

  2. #2
    Join Date
    Dec 1969

    Default RE: How do I?

    (1) WHERE NOT field LIKE &#039;%framitz%&#039;<BR><BR>But you get all the usual warnings that I keep giving you that SQL is not a good way to do textual searches.<BR><BR>*****<BR><BR>&#060;SELECT Name="timePeriod"&#062;<BR>&#060;OPTION&#062;-- choose a time period --<BR>&#060;OPTION Value="3"&#062; past 3 months<BR>&#060;OPTION Value="6"&#062; past 6 months<BR>&#060;OPTION Value="12"&#062; past 12 months<BR>&#060;/SELECT&#062;<BR><BR>ASP:<BR><BR>SQL = "SELECT ... WHERE DateAdd( &#039;m&#039;, " & Request("timePeriod") & ", DateField) &#062; Date() "<BR><BR>If using SQL Server, the &#039;m&#039; becomes just month (no apostrophes) and Date() becomes GetDate(). If using MySQL, check the MySQL docs.<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