Windows Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsOperating SystemsWindows Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 24th, 2001, 09:11 AM
ideal ideal is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2001
Location: NYC
Posts: 5 ideal User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via Yahoo to ideal
MS Access and SQL

Hi -

I'm in the unfortunate position of having to run a SQL query through Access. What I'm trying to accomplish is to search for records that contain keywords within a text field. This is the query I have written:

SELECT TblBusinessInformation.FldComments, TblBusinessInformation.FldBusinessId,
TblBusinessInformation.FldCompanyName, TblBusinessInformation.FldBusinessAddress1,
TblBusinessInformation.FldBusinessAddress2, TblBusinessInformation.FldBusinessCity,
TblBusinessInformation.FldBusinessState, TblBusinessInformation.FldBusinessZipCode

FROM TblBusinessInformation
WHERE (((TblBusinessInformation.FldComments) Like "FEMA" & "SBA" Or
(TblBusinessInformation.FldComments) Is Null));

It doesn't seem to be returning the correct results. Can anyone see anything wrong with this? Also, is it possible to run a NOT LIKE?

Thanks,

Jd

Reply With Quote
  #2  
Old October 28th, 2001, 01:59 AM
Rounin Rounin is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2001
Posts: 1 Rounin User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
SELECT TblBusinessInformation.FldComments, TblBusinessInformation.FldBusinessId,
TblBusinessInformation.FldCompanyName, TblBusinessInformation.FldBusinessAddress1,
TblBusinessInformation.FldBusinessAddress2, TblBusinessInformation.FldBusinessCity,
TblBusinessInformation.FldBusinessState, TblBusinessInformation.FldBusinessZipCode

FROM TblBusinessInformation
WHERE (((TblBusinessInformation.FldComments) Like "FEMA" & "SBA" Or
(TblBusinessInformation.FldComments) Is Null));

The bold text is where is see a possible problem. 1) I'm not sure about the double quotes, I've always used single quotes. Not sure if it matters or not, but I would assume it does. 2) The "like" argument is saying the entire field should be "fema" or whatever, not just a certain part of it. You want a different argument there, off the top of my head, I can't recall it. "IN" maybe??? Sorry bout the ramblin'.

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsWindows Help > MS Access and SQL

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap