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 6971419
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:50:16+00:00 2026-05-27T16:50:16+00:00

Table1 Values 9A 200x400x600 10B 400x200x500 …. Values Column datatype is nvarchar Query Select

  • 0

Table1

Values

9A 200x400x600
10B 400x200x500
....

Values Column datatype is nvarchar

Query

Select * from table1 where values like '" & textbox1.text & "%'

The above query is working, but I want to search in 4 ways

I want to search a column with every 3 digit

The query should not check space and x values from the column.

Expected Output

  • if I type in textbox1 9A or 10A the query should return first 2 or 3 values
  • If I type in textbox2 200 or 400 the query should return 200 from first row or 400 from second row
  • If I type in textbox3 400 or 200 the query should return 400 from first row or 200 from second row
  • If I type in textbox4 600 or 500 the query should return 600 from first row and 500 from second row

How to split the column value for search

Need query 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-27T16:50:16+00:00Added an answer on May 27, 2026 at 4:50 pm

    As you know the query is a the question is a bit confused. I will try, let me know if this is close that you are looking for.

    I assume that:

    9A 200x400x600  -> 200x400x600 are de 3*2+2 lasts characters.
    10B 400x200x500 -> CHARINDEX(' ', value ) = 4
    

    Then, the query is:

    Select 
         * 
    from table1 
    where 
       substring( values, 1, CHARINDEX(' ', value ) ) = '" & textbox1.text & "' OR
       substring( right( value, 3*2+2), 1, 3 ) = '" & textbox2.text & "' OR
       substring( right( value, 3*2+2), 5, 3 ) = '" & textbox3.text & "' OR
       substring( right( value, 3*2+2), 9, 3 ) = '" & textbox4.text & "' 
    

    edited:

    select * from
       (Select 
         substring( values, 1, CHARINDEX(' ', value ) ) as split1,
         substring( right( value, 3*2+2), 1, 3 ) as split2,
         substring( right( value, 3*2+2), 5, 3 ) as split3,
         substring( right( value, 3*2+2), 9, 3 ) as split4,
         * 
       from table1 ) SplitedTable
    where 
       SplitedTable.split1 = '" & textbox1.text & "' OR
       SplitedTable.split2 = '" & textbox2.text & "' OR
       SplitedTable.split3 = '" & textbox3.text & "' OR
       SplitedTable.split4 = '" & textbox4.text & "' 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is something like this possible? INSERT INTO Table2 (val) VALUES ((INSERT INTO Table1 (name)
I need a query to make a Select over table1 and table2. I want
I have an update query like following: update table TABLE1 set COL1 = 'X'
I am looking to select the id of a record from @table1 when that
How can I insert into table1 like: INSERT INTO table1 (description) VALUES ('Some test
Assume Table1 has c1 column for which allowed values are either 1 or 0.
SELECT table1.PrimaryKey(Some ID), table2.nameOfSomething FROM table1 INNER JOIN table2 Here is the part i
what is wrong with this query? INSERT INTO table1 VALUES id, pic0, pic1, pic2,
I have a function that copies values from a table1 to a table2. The
I have a multi-row insert that looks something like: insert into table VALUES (1,

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.