Think this is what you seek.... (sory but its copy-ed out the ms-sql
online books :))


This example displays the first initial and last name of each employee,
for example, A Fuller:

USE Northwind
SELECT SUBSTRING(FirstName, 1, 1), LastName
FROM Employees


Best Regards,
 
HuMPie @ Grunn.Org
---------------------
 
Disclamer:
All you do with the suggestion in this mail is you responsibillity even
if your system will crash :)


-----Original Message-----
From: Jacque Scott [mailto:[EMAIL PROTECTED] 
Sent: dinsdag 27 januari 2004 19:57
To: [EMAIL PROTECTED]
Subject: Using Wildcards in Query


I am converting over to mySQL from Access 2.0 and I am having a little
trouble with a query.  Here it is:
 
SELECT Max(WBS) AS LastOfWBS FROM Projects Where((WBS)) Like """ &
txtEntryData(0).Text & "#%"";

I am trying to get the last WBS ID starting with a particular letter the
user will type in the textbox.  My criteria is that it has to start with
a letter and the next character is a number.  There can be letters or
more numbers to the right of the first number.  For example:  A01C or
B001, but not AB01.  In Access we could use the following query:

SELECT DISTINCT Max([Projects].[WBS]) AS LastOfWBS 
FROM Projects where (Projects.WBS) Like """ & txtEntryData(0).Text &
"#*"";
 
How can I insure when using mySQL that the second character is a number?


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to