473,395 Members | 1,537 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

WHERE statement - need to check if Cell is blank

28
SQL Server 2000

How do you write your query to check for blank (empty) cells?

Need to check 3 columns. ColumnA, ColumnB and ColumnC. I need to grab the data in ColumnA ONLY if ColumnB and ColumnC is empty.

================================================== =======
SELECT ColumnA,

FROM TABLE

WHERE ColumnB = "Blank" AND ColumnC = "Blank"

================================================== =======

What is the correct syntax needed for the "WHERE" statement

Thanks

dhutton
May 24 '07 #1
3 40690
tifoso
41
it depends on the type of field you need to elaborate more on that, it sounds like you may have char or varchar field and if it allows nulls u go by this

...
where field ='' or field is null
May 25 '07 #2
dhutton
28
RE: How do you write your query to check for blank (empty) cells?


What did you mean by?: or field is null

(how would you add this to the WHERE statement?


The field is "char"

So... I tried

================================================== =======
SELECT ColumnA

FROM Table_Name

WHERE COLUMNB =" AND ColumnC = " (This didnt Work)

================================================== =======

SELECT ColumnA

FROM Table_Name

WHERE COLUMNB = NULL AND ColumnC = NULL (This didnt Work)

================================================== =======
May 25 '07 #3
dhutton
28
Ok - I got it.

SELECT ColumnA

FROM Table_Name

WHERE ColumnB = ' ' AND ColumnC = ' '

(single quote, space, single quote)


This works for checking (Char) if cell is blank in a record
May 25 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Raphael Gluck | last post by:
Hi I'm fairly new to coding in asp and i'm trying to create a simple if.. else... condition It's for asp web page, and is linked to my database, but i figured since it's a basic question, it...
7
by: John A. | last post by:
Hello all! I've got a big bunch of pages using tables for layout. Eventually I'll get them set up with more modernized code, but in the meantime I'd like to slip in a little quick holiday...
10
by: ale.of.ginger | last post by:
Greetings! I am trying to make a multiplayer (no AI, 2 person) game of tic tac toe in Python. So far it has been pretty simple. My only concern is with the win checking to see if a person has...
7
by: MLH | last post by:
Building Applications with Microsoft Access 97 is a publication I think I need. Is it available in book form? Is MicroSoft the sole vendor? Anybody got a copy they wanna sell???
6
by: tshad | last post by:
If you have nothing in a cell, the cell doesn't have the inset appearance that all the other cells do. Normally, you could just put a "&ndsp;" in the cell if the it is blank. But how do you do...
1
by: ski854 | last post by:
Hello, i want to see if i can do an and/or statement ex. outputbox 1 requried (ex. ext #) outputbox 2 optional (ex. fax #) outputbox 3 optional (ex. cell #)
1
by: JFKJr | last post by:
Hi!, I have an excel file with 4 columns and the first column has heading "Extract?" followed by blank cells. Now, I would like to check selected rows by double clicking the cell in first column...
1
by: jkozik | last post by:
I am trying to write a iif statement that returns "0" if the cell is blank, otherwise a "1". For some reason this filter returns only 1's regardless of whether the cell is field is blank or not. ...
2
by: slapsh0t11 | last post by:
So, I've been working on this Game of Life (http://www.bitstorm.org/gameoflife/) project, and all the code has been written. However, it will not run. First, I will post the error message and the...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.