Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Sql Statement

Posted on 2000-02-24
9
Medium Priority
?
177 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
  • 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
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!

 

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 200 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

971 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