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
Solved

Searching fields where something is not blank using ASP/VBScript

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
classic asp checkbox uncheck and check 2 69
ASP Button to clear text 4 62
Javascript to allow login/password authorization 4 50
edit .asp files 5 31
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…
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

856 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