Solved

Searching fields where something is not blank using ASP/VBScript

Posted on 2004-10-18
3
238 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

760 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

19 Experts available now in Live!

Get 1:1 Help Now