473,383 Members | 1,864 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Advanced Select Query

I need a query that can return wildcard matches if there's no exact
match. There's how the process works.

1. Input = "my email address is kf***@fsdf.com"
2. Look for exact match.
3. Look for wildcard match.
4. Found = "my * address *"
5. output = "my * address *"

I hope this makes sense,
Thanks in advance
Aaron
Nov 18 '05 #1
1 1284
Aaron, use a SqlDataReader or an OleDbDataReader to query your
database for an exact match - at first use "SELECT [FieldName] FROM
[TableName] WHERE [FieldName]='[SearchCriteria]'".

The results from the .ExecuteReader method will return the total
number of rows affected by the query. If that equals zero (which would
indicate no exact match) then modify the select statement to include
the SQL LIKE keyword and then execute the reader again - "SELECT
[FieldName] FROM [TableName] WHERE [FieldName] LIKE
'[SearchCriteria]'". If it still returns zero then no match would
exist, period.

This process would return and exact or approximate match. HTH JP

ku*****@yahoo.com (Aaron) wrote in message news:<b4**************************@posting.google. com>...
I need a query that can return wildcard matches if there's no exact
match. There's how the process works.

1. Input = "my email address is kf***@fsdf.com"
2. Look for exact match.
3. Look for wildcard match.
4. Found = "my * address *"
5. output = "my * address *"

I hope this makes sense,
Thanks in advance
Aaron

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Pedro Fonseca | last post by:
Greetings! Can someone please help me to crack this problem? I have 4 tables: Subject, Forum, Topic and Post. A Subject groups various Forums, a Forum groups various Topics, and a Topic groups...
4
by: Chen Fock Siong | last post by:
Dear Expert, I have 2 tables as the following, Table : Product Column : ID, Code, Name Table : Trx Column : Trx_ID, Trx_Date, Product_ID
4
by: Nhmiller | last post by:
This is directly from Access' Help: "About designing a query When you open a query in Design view, or open a form, report, or datasheet and show the Advanced Filter/Sort window (Advanced...
1
by: Aaron | last post by:
Sorry for the re-post, my original post wasn't very clear. this is very important. I need a query that can return wildcard matches if there's no exact match. I'm using IIS 5 with ASP.NET and MS...
3
by: doar123 | last post by:
Hi, This is my basic sql shape query: ------------------------------------------------------------ SHAPE {select * from tbl1} APPEND({SELECT * FROM tbl2 where field1=1} AS RS2 RELATE field TO...
3
by: | last post by:
I'm planning to transport a desktop application to the web. A spin-off of this application has already been put on the web by another programmer. He used ColdFusion with MS SQL, Access, VC, and...
0
by: Andrew Meador - ASCPA, MCSE, MCP+I, Network+, A+ | last post by:
I am running Access 2007. I have a report that I want to filter. I can go into Advanced...Advanced Filter/Sort... and setup a filter that works fine on the report when I apply it. When in this...
0
by: Andrew Meador - ASCPA, MCSE, MCP+I, Network+, A+ | last post by:
I am running Access 2007. I have a report that I want to filter. I can go into Advanced...Advanced Filter/Sort... and setup a filter that works fine on the report when I apply it. When in this...
1
by: mbatestblrock | last post by:
I think I have a rather advanced question that I was hoping to find some good help with. I am still pretty new to VBA and I know that doesn't help my situation here. But here is what I am trying to...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.