close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Incorrect search results if searching by date range and any other criteria

Thread began 7/01/2011 5:31 am by YellowCircleWeb | Last modified 7/01/2011 12:18 pm by YellowCircleWeb | 1843 views | 5 replies

YellowCircleWeb

Hi Jason,

I need to have both AND and OR type search results included. My client wanted the search to allow users to enter multiple criteria and not be restricted to all AND type search results e.g. if they incorrectly entered one piece of data, but entered another correctly it would still find a match on the correctly entered field value.

I built a safeguard in to retrieve results only for the currently logged in user by specifying an AND search on the ACCOUNT_REF value, which is a field in the database matched to a session variable that gets set once the user has logged in. However, this seems to be being ignored when using Date range and any other criteria.

I did as you suggested and wrote the SQL query to the page and got the following:

SQL: SELECT * FROM stg_ordersummary WHERE (ORDER_DATE >= "2011-07-01 00:00:00") AND (ORDER_DATE <= "2011-07-01 23:59:59") OR ((CUST_ORDER_NUMBER = '13735')) AND ((ACCOUNT_REF = 'BWEUROPE')) ORDER BY ORDER_DATE DESC

However, records were returned that were outside of the specified date range. Is this down to the fact that my SQL is only applying the AND operator to the dates and then saying - ok no match there, but there's this OR value on the CUST_ORDER_NUMBER field and I've found records that match that field - so that's what's displaying??

Still puzzled as to why I'm getting records returned for other users though who I'm not logged in as????

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...