Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 913807
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T17:37:06+00:00 2026-05-15T17:37:06+00:00

I have a search box where you can enter plain text. The keywords are

  • 0

I have a search box where you can enter plain text. The keywords are separated by spaces.
I check each keyword if it fits the format for a date and store ‘all keywords’ in one array and ‘date keywords’ in another. All the ‘date keywords’ are also in the ‘all keywords’ array, as I can not tell if its ‘only’ a date or maybe also a description or name. I search over many fields like name, description, etc…

I use something like

SELECT * FROM Tbl
WHERE NOT EXISTS(
    SELECT * FROM @SearchItems WHERE NOT( 
    name LIKE SItem OR
    description LIKE SItem OR
    field3 LIKE SItem)
)

This searches for entries, where no searchitems exist, that are not found -> Means, it shows only items, where all searchitems are found in any field. I use these two ‘NOT’s because otherwise I would have to check if the count of found items = count of all items.

But now I have a problem with the dates. Because 10/05/05 is a date but could also be a number in the description. So I want to get all items where there is a 10/05/05 in one of the normal fields, or the date matches the specific date.

But if i add somehting like

AND NOT EXISTS(
    SELECT * FROM @DateItems WHERE NOT(
    date = DItem)
)

It means, that the item needs to have 10/05/05 as string in a field AND as date, but if I use OR, it means that all item with the right day will be shown, regardless of the other keywords. If I delete the ‘date-keywords’ from the ‘all-keywords’ it would not find the string in the description.

How to fix this? I want to get all items from the date, or with the date in description when I enter ’10/05/05′ but if I enter ‘blue 10/05/05’ blue has to be in one of the fields and 10/05/05 could be in a normal field OR the date.

Edit: I forgot to mention: In the ‘all-keywords’ array, the dates are in original format like ’10/05/05′. The keywords realized as dates are stored in the ‘date-keywords’ array in ISO format ‘2005-05-10’. So i cant do something like WHERE DItem = date OR description like DItem.

As this is a bit hard to describe, please ask if anything is unclear.
Thanks for any help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T17:37:06+00:00Added an answer on May 15, 2026 at 5:37 pm

    I found a solution. And because it took me a good while to get to this soltion i will write it down here, so someone will maybe get help from it.

    Since a possible date also should be a regular search string, the search fails when this string is not found. The only exception is when the interpreted date of the string matches the date of the item (in which case the string representation does not need to be found somewhere). But to do this you need to know which ‘date-keyword’ belongs to which ‘all-keywords’ search string.

    If you have this relation, it is possible to accept an item if the string representation is found OR if the date matches.

    So now i load the dates with their string representations into a table and have a simple
    OR relation between them: WHERE Date = DateItem OR Field = StrItem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

id like to have an input box that a user can enter a search
Possible Duplicate: Bind textbox to 'enter' key I have a search text box. I
I have the following problem: I have a search box in which user can
I have a search box on my site. If a student enters some text,
I have an edit text which functions as a search box in my application.
I have a UI with a search text box and a button that that
I have asp.net TextBox with ontextchanged event this is search text box in my
I have a search form: <form id=global_search> <input id=global_search_input name=search_query placeholder=Enter search text> <input
I have a search box on my site and i need to replace all
I have a search box and search button. I want to call a javascript

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.