If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > Begins With

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-18-03, 16:50
Gurka Gurka is offline
Registered User
 
Join Date: Jul 2003
Posts: 6
Begins With

I am trying to reduce the number of fax numbers I have in my access database querying out all numbers except 6 area codes.

I have tried to do:

SELECT FaxNumbers
FROM FAXList
WHERE FaxNumbers BEGINS WITH 972 OR 817 OR 214;

but it doesn't work, what am I doing wrong?
Reply With Quote
  #2 (permalink)  
Old 07-18-03, 17:03
aruneeshsalhotr aruneeshsalhotr is offline
Registered User
 
Join Date: Jul 2003
Location: US
Posts: 314
Correct Query

Hi
Try the following query

select phone from users where phone like '301%' or phone like '201%' or phone like '212%';
Thanx and Regards
Aruneesh
Reply With Quote
  #3 (permalink)  
Old 07-18-03, 17:10
Gurka Gurka is offline
Registered User
 
Join Date: Jul 2003
Posts: 6
LIKE %

I have tried both the command BEGINS WITH 972 or 817 or 214 or 903 and LIKE 972% or 817% or 214% or 903%, and neither work. I get no results even though I know that there are some in there.

Can anybody help me?
Gurka
Reply With Quote
  #4 (permalink)  
Old 07-18-03, 17:11
aruneeshsalhotr aruneeshsalhotr is offline
Registered User
 
Join Date: Jul 2003
Location: US
Posts: 314
Could u post the command u r using to query the DB.
Reply With Quote
  #5 (permalink)  
Old 07-18-03, 18:41
Gurka Gurka is offline
Registered User
 
Join Date: Jul 2003
Posts: 6
I think I got it to work.
I used * instead of %.

Gurka
Reply With Quote
  #6 (permalink)  
Old 07-18-03, 19:16
aruneeshsalhotr aruneeshsalhotr is offline
Registered User
 
Join Date: Jul 2003
Location: US
Posts: 314
GOOD LUCK

Gurka
Good luck with your query.
Aruneesh
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On