473,396 Members | 1,767 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,396 software developers and data experts.

Problem on SELECT statement

12
I searched a statement in google which is very common

e.g. data
Name ID
Carmen 123
David 456
Daisy 789
John 431
Leon 670
Simon 553

SELECT ID FROM data WHERE Name LIKE 'D%';

This is a very very common code where SELECT...FROM....WHERE.....LIKE.....

This will search all the data from data which begin with d
which result is 456 and 789

However I don't know why this function cannot work in my access2000 environment......

It always can't search the string with % at the end

Which
SELECT ID FROM data WHICH Name LIKE 'DAVID';
result return is david
SELECT ID FROM data WHICH Name LIKE 'DAVI?';
result is david too....
However
SELECT ID FROM data WHICH Name LIKE 'DAVI%';
Result is nothing.....

HELP
My company need me finish this project in one week and the deadline is coming......
Jun 27 '06 #1
3 2028
hi
In access u use * instead of %
so your query must be
SELECT ID FROM data WHERE Name LIKE 'D*';

I wish u finish before ur dead line, tell me if u need anyhelp
Best wishes
Hesham el ebrashy
Jul 6 '06 #2
xpcer
51
that's right, in access u must use * not %.
if u use _ in mssql, u must use ?

for example :

in mssql :
SELECT ID FROM data WHERE Name LIKE 'D_VID';

in acces:

SELECT ID FROM data WHERE Name LIKE 'D?VID';
Jul 14 '06 #3
Hello,

You can try that :

SELECT ID FROM data WHICH Name LIKE 'DAVI*';

It's the solutions I find in a the next site :
http://www.fgcu.edu/support/office2000/access/queries.html

bye

Sylvie


I searched a statement in google which is very common

e.g. data
Name ID
Carmen 123
David 456
Daisy 789
John 431
Leon 670
Simon 553

SELECT ID FROM data WHERE Name LIKE 'D%';

This is a very very common code where SELECT...FROM....WHERE.....LIKE.....

This will search all the data from data which begin with d
which result is 456 and 789

However I don't know why this function cannot work in my access2000 environment......

It always can't search the string with % at the end

Which
SELECT ID FROM data WHICH Name LIKE 'DAVID';
result return is david
SELECT ID FROM data WHICH Name LIKE 'DAVI?';
result is david too....
However
SELECT ID FROM data WHICH Name LIKE 'DAVI%';
Result is nothing.....

HELP
My company need me finish this project in one week and the deadline is coming......
Jul 24 '06 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Nicolas Payre | last post by:
Hi, I have the following SQL that I want to use to update a table. It doesn't work ! Does someone knows why? ** I Know it could be done easy with a CURSOR FOR LOOP, but still... Thanks for...
10
by: JMorrell | last post by:
First post to this community so am not sure if this is the correct place. Here goes. I have a MS Access db that keeps track of employees sick and annual leave balances. In it, I have a report,...
5
by: Ritesh | last post by:
Hi All, According to my observation using SP_WHO2 in my database, some INSERT statements are getting blocked by SELECT statements. Though the blocking SELECT statement is having ReadPast hint,...
15
by: Hemant Shah | last post by:
Folks, We have an SQL statement that was coded in an application many years ago (starting with DB V2 I think). When I upgraded to UDB 8.2, the optimizer does not use optimal path to access the...
4
by: Mervin Williams | last post by:
I have several tables involved in my application, but the two in question here are the company and address tables. The company table has business_address_id and mailing_address_id columns, which...
1
by: tom.eeraerts | last post by:
Hello, I have a problem migrating an application from v5r2 to v5r3. The problem is with the prepared statements. To see what the problem is, i extracted a small piece of code and debugged the...
3
by: shark | last post by:
Hi all. i am facing a deadlock problem .i have included the -t1204 and -T3605 trace flags and have got the following o/p pu tin sqls server logs. 2006-06-01 17:49:21.84 spid4 2006-06-01...
8
by: Ian Mackenzie | last post by:
Hi Guys I am VERY new to DB2 and have created a workingdays function to return the working days between 2 dates, but I get some compiler errors when running it: CREATE FUNCTION WORKINGDAYS...
9
by: HC | last post by:
Hello, all, I started out thinking my problems were elsewhere but as I have worked through this I have isolated my problem, currently, as a difference between MSDE and SQL Express 2005 (I'll just...
10
by: amitabh.mehra | last post by:
Hi I havent used MQT before. Read the online tips and tutorials but none seems to give any hint for my problem. I have a base table (base_table) as: st varchar(25) default...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.