Solved

Sql Statement

Posted on 2000-02-24
9
173 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
Technology Partners: 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!

 

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

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

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

726 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