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

  • Home
  • SEARCH
  • 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 7845951
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T17:24:50+00:00 2026-06-02T17:24:50+00:00

I have the records in the database like this which are as follows. I

  • 0

I have the records in the database like this which are as follows. I want to search in the Account Column which is my last column in my AccountDetails Table. I want to searching based on conditions like

1- want to findt hose records which contain a hyphen after 1st number (which can be anything)
12- want to find those records which contain a hyphen after 2nd number (which can be anything)
123-want to find those records which contain a hyphen after 3rd number (which can be anything)

AccountDetail Table

230263  jba 100-1807
230263  jba 100-1808
230263  jba 100-1809
235572  jba 99-1818
235572  jba 99-1819
235572  jba 99-1820
235572  jba 9-1818
235572  jba 9-1819
235572  jba 9-1820

I have done like this

Select * From WF_Account Where CompanyId = 'jba' and Account Like '%-%'
  • 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-06-02T17:24:51+00:00Added an answer on June 2, 2026 at 5:24 pm

    Not sure which version of sql you are running.

    but in SQL Server you can use CHARINDEX or in sql 2012 FINDSTRING

    e.g

    WHERE CHARINDEX('-', Col1) > 0
    

    EDIT:

    You can also use PATINDEX which returns the position of string for a pattern.

    so maybe:

    WHERE PATINDEX('%-', Col1) <= 3
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have like 400 records on my database, suppose this is the first version
I have a function which calculates distance from database records. This function is called
I have a MySQL database and a table which has a names column as
I have 50000 XML records like this in the database: <?xml version=1.0 encoding=UTF-8?> <root>
I have an application with like 400 records in the database, I have splash
I have records in the database with the sort order number. Now I want
I have an app which will generate 5 - 10 new database records in
I have stored various records in the MySql database orkut. Now I want to
I want to check my database for records that I already have recorded before
I have an existing Access database which contains training records for employees. If an

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.