|
-
September 29th, 1999, 10:14 AM
#1
Like command
Hi,
I use following SQL-String to get all eMails in my Access Database belonging to the same domain:
sql.Format( "SELECT login, passwort, email FROM Accountdaten WHERE email Like '*%s*'", domain );
But for some reason LIKE doesn't work. Can u tell me where the problem is? I have MDAC SP1 installed.
Thanx in advanced
Karsten
-
September 29th, 1999, 12:02 PM
#2
Re: Like command
In SQL, the wildcard character is not "*", it's "%". SO, to say "every domain with 'microsoft' in it, you'd write it as:
SELECT login, passwort, email FROM Accountdaten WHERE email Like '%micorosoft%'"
Of course, using th Format() complictes this:
sql.Format( "SELECT login, passwort, email FROM Accountdaten WHERE email Like '%%%s%%'", domain );
Two %s become one % when passed through printf/format
Truth,
James
http://www.NJTheater.com
http://www.NJTheater.com/JamesCurran
-
October 1st, 1999, 06:35 AM
#3
Re: Like command
Hi,
jeah, that really works. Thanx a lot.
But I still have another question. Ist there a command for searching all fields at one time for a keyword?
at the moment I have to do it with Like for each field. Ist there another command available which can do this on it's own? If yes, can u give me an example?
Thanx in advance
Karsten
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|