Solved

Sql Statement

Posted on 2000-02-24
9
172 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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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

 

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone 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

Suggested Solutions

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

838 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