3 messages in com.mysql.lists.mysqlRe: SQL select help required please
FromSent OnAttachments
Matthew Stuart01 Feb 2004 15:15 
Daniel Kasak01 Feb 2004 15:36 
Matthew Stuart02 Feb 2004 02:46 
Subject:Re: SQL select help required please
From:Matthew Stuart (mr@btinternet.com)
Date:02/02/2004 02:46:05 AM
List:com.mysql.lists.mysql

I am trying to create a html search results page with the following:

SELECT * FROM tbl_allarticles WHERE (fld_headline LIKE'%userinput%' OR fld_summary LIKE'%userinput%' OR fld_body LIKE'%userinput%') AND fld_category LIKE 'catvalue'

The above works fine, but the below code is giving me some jip… (It is simply a command to look for dates between user inputted start and end dates, but it is not working) it just follows on from the above code:

AND fld_reldate BETWEEN 'startdatevalue' AND 'enddatevalue'

What problem are you having exactly? An error, or just not getting the results you expected? Maybe you need to format the date in yyyymmdd format before giving it to MySQL.

The problem I am having is that I am getting a Data type mismatch in criteria expression error.

The way I understand this to work is the quotes around the start and end date values make these values variables which will be issued at runtime by the user when submitting the form on the previous page. Is that right?