vs 2002/xp pro/win forms/MS access 2002

I want to query my database where fieldA = "" (Blank)

Select MYDB where fieldA = "" or Blank or Null

What is the correct syntax for checking for "" blanks nulls
thanks

Re: testing for "" blank nulls by William

William
Mon Apr 26 15:03:46 CDT 2004

I'm guessing you mean on the DB side vs DataTable.Select. Anyway, the
syntax is checking for '' (single quotes) or IS NULL (in access ISNULL
returns true or false if you don't put a space, it's a function instead of a
condition so make sure you use two words).

In general, client side if you want to test for '' use string.Empty.

HTH,

BIll
"Tony" <Tony_NOPE_Mast@MSN.Com> wrote in message
news:#UXBah8KEHA.3712@TK2MSFTNGP11.phx.gbl...
> vs 2002/xp pro/win forms/MS access 2002
>
> I want to query my database where fieldA = "" (Blank)
>
> Select MYDB where fieldA = "" or Blank or Null
>
> What is the correct syntax for checking for "" blanks nulls
> thanks
>
>



Re: testing for "" blank nulls by Tony

Tony
Mon Apr 26 15:54:24 CDT 2004

I've tried


SQL="select * from DB where RecordStatus = " & "'" & "'" & " order by
CompanyName"
Select * from DB where RecordStatus = '' order by CompanyName
and returns no records

also tried
SQL = "Select * from DB where RecordStatus = Is Null order by CompanyName"
also returns no records

also tried
SQL="select * from DB where RecordStatus = " & "'" & "Is Null" & "'" & "
order by CompanyName"
select * from DB where RecordStatus = 'Is Null' order by CompanyName"
also retrurns no records

The field RecordStatus is a newly created field and all records have a blank
or Null value
Where am I going wrong?

Thanks


"William Ryan eMVP" <dotnetguru@comcast.nospam.net> wrote in message
news:OHrl7j8KEHA.2704@TK2MSFTNGP10.phx.gbl...
> I'm guessing you mean on the DB side vs DataTable.Select. Anyway, the
> syntax is checking for '' (single quotes) or IS NULL (in access ISNULL
> returns true or false if you don't put a space, it's a function instead of
a
> condition so make sure you use two words).
>
> In general, client side if you want to test for '' use string.Empty.
>
> HTH,
>
> BIll
> "Tony" <Tony_NOPE_Mast@MSN.Com> wrote in message
> news:#UXBah8KEHA.3712@TK2MSFTNGP11.phx.gbl...
> > vs 2002/xp pro/win forms/MS access 2002
> >
> > I want to query my database where fieldA = "" (Blank)
> >
> > Select MYDB where fieldA = "" or Blank or Null
> >
> > What is the correct syntax for checking for "" blanks nulls
> > thanks
> >
> >
>
>



Re: testing for "" blank nulls by Norman

Norman
Mon Apr 26 16:35:37 CDT 2004

SQL="SELECT * FROM DBTable WHERE (RecordStatus='') OR (RecordStatus IS
NULL) ORDER BY CompanyName"

"Tony" <Tony_NOPE_Mast@MSN.Com> wrote in message
news:%239DErC9KEHA.4032@TK2MSFTNGP10.phx.gbl...
> I've tried
>
>
> SQL="select * from DB where RecordStatus = " & "'" & "'" & " order by
> CompanyName"
> Select * from DB where RecordStatus = '' order by CompanyName
> and returns no records
>
> also tried
> SQL = "Select * from DB where RecordStatus = Is Null order by CompanyName"
> also returns no records
>
> also tried
> SQL="select * from DB where RecordStatus = " & "'" & "Is Null" & "'" &
"
> order by CompanyName"
> select * from DB where RecordStatus = 'Is Null' order by CompanyName"
> also retrurns no records
>
> The field RecordStatus is a newly created field and all records have a
blank
> or Null value
> Where am I going wrong?
>
> Thanks
>
>
> "William Ryan eMVP" <dotnetguru@comcast.nospam.net> wrote in message
> news:OHrl7j8KEHA.2704@TK2MSFTNGP10.phx.gbl...
> > I'm guessing you mean on the DB side vs DataTable.Select. Anyway, the
> > syntax is checking for '' (single quotes) or IS NULL (in access ISNULL
> > returns true or false if you don't put a space, it's a function instead
of
> a
> > condition so make sure you use two words).
> >
> > In general, client side if you want to test for '' use string.Empty.
> >
> > HTH,
> >
> > BIll
> > "Tony" <Tony_NOPE_Mast@MSN.Com> wrote in message
> > news:#UXBah8KEHA.3712@TK2MSFTNGP11.phx.gbl...
> > > vs 2002/xp pro/win forms/MS access 2002
> > >
> > > I want to query my database where fieldA = "" (Blank)
> > >
> > > Select MYDB where fieldA = "" or Blank or Null
> > >
> > > What is the correct syntax for checking for "" blanks nulls
> > > thanks
> > >
> > >
> >
> >
>
>



Re: testing for "" blank nulls by William

William
Mon Apr 26 17:06:26 CDT 2004

Remember back from the old Relational Database class, "Null doesn't equal
anything not even itself"

Anyway you can't use an = sign if you are testing for null. Ever.

SQL = "Select * from DB where RecordStatus Is Null order by CompanyName"

If you just take the = out like above, you'll be fine.

HTH,

Bill
"Tony" <Tony_NOPE_Mast@MSN.Com> wrote in message
news:%23UXBah8KEHA.3712@TK2MSFTNGP11.phx.gbl...
> vs 2002/xp pro/win forms/MS access 2002
>
> I want to query my database where fieldA = "" (Blank)
>
> Select MYDB where fieldA = "" or Blank or Null
>
> What is the correct syntax for checking for "" blanks nulls
> thanks
>
>



Re: testing for "" blank nulls by Tony

Tony
Mon Apr 26 17:38:26 CDT 2004

Thank you thank you and thank you




"William Ryan eMVP" <bill@NoSp4m.devbuzz.com> wrote in message
news:eSAa0q9KEHA.556@tk2msftngp13.phx.gbl...
> Remember back from the old Relational Database class, "Null doesn't equal
> anything not even itself"
>
> Anyway you can't use an = sign if you are testing for null. Ever.
>
> SQL = "Select * from DB where RecordStatus Is Null order by CompanyName"
>
> If you just take the = out like above, you'll be fine.
>
> HTH,
>
> Bill
> "Tony" <Tony_NOPE_Mast@MSN.Com> wrote in message
> news:%23UXBah8KEHA.3712@TK2MSFTNGP11.phx.gbl...
> > vs 2002/xp pro/win forms/MS access 2002
> >
> > I want to query my database where fieldA = "" (Blank)
> >
> > Select MYDB where fieldA = "" or Blank or Null
> >
> > What is the correct syntax for checking for "" blanks nulls
> > thanks
> >
> >
>
>