Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

The Database Forum


You are currently viewing our The Database Forum as a guest. Please register to participate.
Login



Reply
selecting records where first letter =
Old 08-23-2006, 10:30 AM selecting records where first letter =
numbenator's Avatar
Webmaster Talker

Posts: 516
Location: London
Trades: 0
Hi all,

Is it possible using sql to select records where the first letter of a field equals a given value?

cheers
Steve
__________________

Please login or register to view this content. Registration is FREE
numbenator is offline
Reply With Quote
View Public Profile Visit numbenator's homepage!
 
 
Register now for full access!
Old 08-23-2006, 11:23 AM Re: selecting records where first letter =
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,938
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
If it's access, I know Select Fields from Table where Left (Field_Name, 1) = 'A' works.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 08-23-2006, 12:14 PM Re: selecting records where first letter =
foobar's Avatar
Extreme Talker

Posts: 225
Trades: 0
Easy to do using LIKE in your where clause. For example, if you want to return the records in a given table where the "Name" field value for that record starts with 'M', you'd do something like:

SELECT * FROM users WHERE name LIKE 'A%'

% is a wild card. SO you could do '%ING' to get everything ending in ING, or '%RT%' to get everything that has 'RT' anywhere in it, etc.
foobar is offline
Reply With Quote
View Public Profile Visit foobar's homepage!
 
Reply     « Reply to selecting records where first letter =
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.11353 seconds with 12 queries