Solved

Sql Statement

Posted on 2000-02-24
9
174 Views
Last Modified: 2010-05-02
HI,

I am having a problem with a sql statement.
What i am trying to do is, a search in a table on a paradox database. The field is of type Long integer.
I am doing a search criteria where the field Error is equal to nothing, eg: the field is blank, has no data what so ever in it.
This is my statement :
SqlReadNoErrors = "SELECT * FROM Entry_de where Error = " & Null & ""
When i run the code it gives a syntax error, operator missing...

What could be wrong?

Thanks!
0
Comment
Question by:mscala
[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
  • 5
  • 2
  • 2
9 Comments
 
LVL 9

Expert Comment

by:Ruchi
ID: 2556875
change
SqlReadNoErrors = "SELECT * FROM Entry_de where Error = " & Null & ""

to

SqlReadNoErrors = "SELECT * FROM Entry_de where Error = " & Null & "
0
 

Expert Comment

by:pinshah
ID: 2556880
try doing this

"where Error  = Null" instead of

"where Error = " & Null & "" as the tool or language in which u r making ur application can have different meaning for Null then the underline database

if u concatenate the Null it will be transformed to a value which ur application knows and it may not be compatible with the database.


0
 
LVL 9

Expert Comment

by:Ruchi
ID: 2556892
try this one.
SqlReadNoErrors = "SELECT * FROM Entry_de where Error Is Null
0
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 

Author Comment

by:mscala
ID: 2556901
Ruchi - firstly u are leaving out one of the " which it needs in.

pinshah - i don't necessarliy have to use Null, it was just something i was trying, for i am not looking for a value of null, i am searching for a blank value...
0
 
LVL 9

Expert Comment

by:Ruchi
ID: 2556903
SqlReadNoErrors = "SELECT * FROM Entry_de where Error = ''

This code and The above I posted are the same thing.
0
 
LVL 9

Accepted Solution

by:
Ruchi earned 50 total points
ID: 2556908
I miss the enclosing " on the same line.

SqlReadNoErrors = "SELECT * FROM Entry_de where Error = ''"

SqlReadNoErrors = "SELECT * FROM Entry_de where Error Is Null"

0
 

Expert Comment

by:pinshah
ID: 2556910
I think '' is not same as is Null or Null '' is a empty string and Null has a different value which applies not only for strings but also for other datatypes. If error is a number it will give a type mismatch ( or related database errror)
0
 

Author Comment

by:mscala
ID: 2556913
Thanks Ruchi, the Is Null worked.
Thanks very much
0
 
LVL 9

Expert Comment

by:Ruchi
ID: 2556919
Mscala, You are welcome! I'm glad that I could be of any help to you. :-)
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

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