Solved

Searching fields where something is not blank using ASP/VBScript

Posted on 2004-10-18
3
239 Views
Last Modified: 2008-03-17
Hello...this shouldn't be a hard question...I just have no idea about the ASP syntax.

I have a SQL search set up in an ASP file that is selecting certain fields where a condition is met. I want to add in a second condition...that another field is not blank. The field I am adding to this query is "WHERE HistoricalSignificance (IS NOT BLANK)...."

rsRegion.Source = "SELECT City, Historical_Era1, MailingListID, OrganizationName, Region, SiteOrg_Type FROM Sites_Orgs WHERE HistoricalSignificance =" " + Region = '" + Replace(rsRegion__MMColParam, "'", "''") + "' ORDER BY OrganizationName ASC"

rsRegion.Source = "SELECT City, Historical_Era1, MailingListID, OrganizationName, Region, SiteOrg_Type FROM Sites_Orgs WHERE HistoricalSignificance <> " " + Region = '" + Replace(rsRegion__MMColParam, "'", "''") + "' ORDER BY OrganizationName ASC"

are two strategies I have tried. Both result in errors. Any suggestions?

Thanks!!!
0
Comment
Question by:htillberg
  • 3
3 Comments
 
LVL 20

Expert Comment

by:jitganguly
ID: 12340278
use this

WHERE (HistoricalSignificance <> '' or HistoricalSignificance  is not null)


0
 
LVL 20

Expert Comment

by:jitganguly
ID: 12340289
Use single quotes

rsRegion.Source = "SELECT City, Historical_Era1, MailingListID, OrganizationName, Region, SiteOrg_Type FROM Sites_Orgs WHERE (HistoricalSignificance <> '' or  HistoricalSignificance is not null) + Region = '" + Replace(rsRegion__MMColParam, "'", "''") + "' ORDER BY OrganizationName ASC"

0
 
LVL 20

Accepted Solution

by:
jitganguly earned 250 total points
ID: 12340302
Still wrong , you are missing and before region

rsRegion.Source = "SELECT City, Historical_Era1, MailingListID, OrganizationName, Region, SiteOrg_Type FROM Sites_Orgs WHERE (HistoricalSignificance <> '' or  HistoricalSignificance is not null) AND Region = '" + Replace(rsRegion__MMColParam, "'", "''") + "' ORDER BY OrganizationName ASC"
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now