Solved

Searching fields where something is not blank using ASP/VBScript

Posted on 2004-10-18
3
243 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
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/…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

728 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