PC Review


Reply
Thread Tools Rate Thread

sql statement w/ where clause of part of a field.

 
 
SteveN
Guest
Posts: n/a
 
      4th Sep 2003
Could someone tell me how I might be able to construct a
sql statement with a where clause that matches only part
of the field?

For example I'd like to do a select statement with a
where clause that matches the first three digits of a
column/field. ie SELECT * FROM ABC WHERE XYZ = 123.

ABC = table name
XYZ = column
123 = the first three digits of XYZ column (note the XYZ
column could contain 123789 or 123546 and they would be
selected). Thanks in advance for any suggestions!


 
Reply With Quote
 
 
 
 
Duane Hookom
Guest
Posts: n/a
 
      4th Sep 2003
SELECT * FROM ABC WHERE XYZ Like "123*"
or
SELECT * FROM ABC WHERE Left(XYZ,3) = "123"

--
Duane Hookom
Microsoft Access MVP


"SteveN" <(E-Mail Removed)> wrote in message
news:16c601c37297$eb365320$(E-Mail Removed)...
> Could someone tell me how I might be able to construct a
> sql statement with a where clause that matches only part
> of the field?
>
> For example I'd like to do a select statement with a
> where clause that matches the first three digits of a
> column/field. ie SELECT * FROM ABC WHERE XYZ = 123.
>
> ABC = table name
> XYZ = column
> 123 = the first three digits of XYZ column (note the XYZ
> column could contain 123789 or 123546 and they would be
> selected). Thanks in advance for any suggestions!
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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 On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Top Clause with GROUP BY clause? Dan Microsoft Access Queries 2 17th Dec 2008 08:27 PM
Can I use a between clause or in clause on an IF statement =?Utf-8?B?c3NjaWFycmlubw==?= Microsoft Excel Programming 2 4th May 2007 04:48 PM
Where clause in SQL statement problem Giganews Microsoft Access Form Coding 3 11th Feb 2005 05:42 AM
Is Access SQL FROM Clause different from MS SQL Server SQL? David Perkins Microsoft Access Queries 1 20th Oct 2004 08:26 PM
SQL - Conditional Terms in WHERE part of SQL Statement Bob T Microsoft ADO .NET 2 19th Nov 2003 09:08 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:13 AM.