Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Searching fields where something is not blank using ASP/VBScript

Posted on 2004-10-18
3
Medium Priority
?
248 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 1000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
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/…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

618 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