473,500 Members | 1,605 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Sql statement

Can someone tell me why my query returns nothing?

"Select EmployeeID, SSN, LastName, FirstName, Address, City, State, Zipcode,
Phone from Employee where MiddleName ='' "

However this works fine.
"Select EmployeeID, SSN, LastName, FirstName, Address, City, State, Zipcode,
Phone from Employee where MiddleName ='M' "

I have checked the Employee table and I have several records with no value
in the MiddleName column.

I am using MS Access'

Please help this is driving me crazy.
May 24 '06 #1
19 1271
Are you sure you don't need to use a LIKE

For Middle Names that begin with:
"Select EmployeeID, SSN, LastName, FirstName, Address, City, State, Zipcode,
Phone from Employee where MiddleName like 'M%' "

For Middle Names that contain (any where)
"Select EmployeeID, SSN, LastName, FirstName, Address, City, State, Zipcode,
Phone from Employee where MiddleName like '%M%' "

For Middle Names that end with...
"Select EmployeeID, SSN, LastName, FirstName, Address, City, State, Zipcode,
Phone from Employee where MiddleName like '%M' "
-Wayne
"momo" <ma***@seeourweb.com> wrote in message
news:uO**************@TK2MSFTNGP04.phx.gbl...
Can someone tell me why my query returns nothing?

"Select EmployeeID, SSN, LastName, FirstName, Address, City, State,
Zipcode, Phone from Employee where MiddleName ='' "

However this works fine.
"Select EmployeeID, SSN, LastName, FirstName, Address, City, State,
Zipcode, Phone from Employee where MiddleName ='M' "

I have checked the Employee table and I have several records with no value
in the MiddleName column.

I am using MS Access'

Please help this is driving me crazy.

May 24 '06 #2
Thank for replying Wayne.

No, I need to retrieve only the records without any MiddleName. I am looking
for blank MiddleNames.

"Wayne" <wa***@nospam.cfwebmasters.com> wrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
Are you sure you don't need to use a LIKE

For Middle Names that begin with:
"Select EmployeeID, SSN, LastName, FirstName, Address, City, State,
Zipcode, Phone from Employee where MiddleName like 'M%' "

For Middle Names that contain (any where)
"Select EmployeeID, SSN, LastName, FirstName, Address, City, State,
Zipcode, Phone from Employee where MiddleName like '%M%' "

For Middle Names that end with...
"Select EmployeeID, SSN, LastName, FirstName, Address, City, State,
Zipcode, Phone from Employee where MiddleName like '%M' "
-Wayne
"momo" <ma***@seeourweb.com> wrote in message
news:uO**************@TK2MSFTNGP04.phx.gbl...
Can someone tell me why my query returns nothing?

"Select EmployeeID, SSN, LastName, FirstName, Address, City, State,
Zipcode, Phone from Employee where MiddleName ='' "

However this works fine.
"Select EmployeeID, SSN, LastName, FirstName, Address, City, State,
Zipcode, Phone from Employee where MiddleName ='M' "

I have checked the Employee table and I have several records with no
value in the MiddleName column.

I am using MS Access'

Please help this is driving me crazy.


May 24 '06 #3
Try using where len(ltrim(MiddleName)) = 0...
May 24 '06 #4
momo wrote:
Can someone tell me why my query returns nothing?

"Select EmployeeID, SSN, LastName, FirstName, Address, City, State, Zipcode,
Phone from Employee where MiddleName ='' "


Is MiddleName null?

Try "... where MiddleName = null" or "... where MiddleName is null".

I haven't used Access much, so I'm not sure on the syntax.
--
David Hogue
May 24 '06 #5
If the value is null (in the db), an empty string is NOT the same thing as
null.

I'm not super sure with access, but I think the query is

"Select EmployeeID, SSN, LastName, FirstName, Address, City, State, Zipcode,
Phone from Employee where MiddleName IS NULL"
that's the sql server syntax, I think access is the same.

"Wayne" <wa***@nospam.cfwebmasters.com> wrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl... Are you sure you don't need to use a LIKE

For Middle Names that begin with:
"Select EmployeeID, SSN, LastName, FirstName, Address, City, State, Zipcode, Phone from Employee where MiddleName like 'M%' "

For Middle Names that contain (any where)
"Select EmployeeID, SSN, LastName, FirstName, Address, City, State, Zipcode, Phone from Employee where MiddleName like '%M%' "

For Middle Names that end with...
"Select EmployeeID, SSN, LastName, FirstName, Address, City, State, Zipcode, Phone from Employee where MiddleName like '%M' "
-Wayne
"momo" <ma***@seeourweb.com> wrote in message
news:uO**************@TK2MSFTNGP04.phx.gbl...
Can someone tell me why my query returns nothing?

"Select EmployeeID, SSN, LastName, FirstName, Address, City, State,
Zipcode, Phone from Employee where MiddleName ='' "

However this works fine.
"Select EmployeeID, SSN, LastName, FirstName, Address, City, State,
Zipcode, Phone from Employee where MiddleName ='M' "

I have checked the Employee table and I have several records with no value in the MiddleName column.

I am using MS Access'

Please help this is driving me crazy.


May 24 '06 #6
Sorry, I misread that.

Try testing for length after triming trailing spaces. I believe the syntax
is:

"Select EmployeeID, SSN, LastName, FirstName, Address, City, State, Zipcode,
Phone from Employee where len(ltrim(MiddleName)) = 0"

"momo" <ma***@seeourweb.com> wrote in message
news:uc*************@TK2MSFTNGP05.phx.gbl...
Thank for replying Wayne.

No, I need to retrieve only the records without any MiddleName. I am
looking for blank MiddleNames.

"Wayne" <wa***@nospam.cfwebmasters.com> wrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
Are you sure you don't need to use a LIKE

For Middle Names that begin with:
"Select EmployeeID, SSN, LastName, FirstName, Address, City, State,
Zipcode, Phone from Employee where MiddleName like 'M%' "

For Middle Names that contain (any where)
"Select EmployeeID, SSN, LastName, FirstName, Address, City, State,
Zipcode, Phone from Employee where MiddleName like '%M%' "

For Middle Names that end with...
"Select EmployeeID, SSN, LastName, FirstName, Address, City, State,
Zipcode, Phone from Employee where MiddleName like '%M' "
-Wayne
"momo" <ma***@seeourweb.com> wrote in message
news:uO**************@TK2MSFTNGP04.phx.gbl...
Can someone tell me why my query returns nothing?

"Select EmployeeID, SSN, LastName, FirstName, Address, City, State,
Zipcode, Phone from Employee where MiddleName ='' "

However this works fine.
"Select EmployeeID, SSN, LastName, FirstName, Address, City, State,
Zipcode, Phone from Employee where MiddleName ='M' "

I have checked the Employee table and I have several records with no
value in the MiddleName column.

I am using MS Access'

Please help this is driving me crazy.



May 24 '06 #7
I tried that already and it did not work.

"David Hogue" <da************@gmail.com> wrote in message
news:2Z*****************@fe09.news.easynews.com...
momo wrote:
Can someone tell me why my query returns nothing?

"Select EmployeeID, SSN, LastName, FirstName, Address, City, State,
Zipcode,
Phone from Employee where MiddleName ='' "


Is MiddleName null?

Try "... where MiddleName = null" or "... where MiddleName is null".

I haven't used Access much, so I'm not sure on the syntax.
--
David Hogue

May 24 '06 #8
Did not work

"Brad Roberts" <Br*****************@hotmail.com> wrote in message
news:2E**********************************@microsof t.com...
Try using where len(ltrim(MiddleName)) = 0...

May 24 '06 #9
Still won't work

"Wayne" <wa***@nospam.cfwebmasters.com> wrote in message
news:Ob**************@TK2MSFTNGP04.phx.gbl...
Sorry, I misread that.

Try testing for length after triming trailing spaces. I believe the
syntax is:

"Select EmployeeID, SSN, LastName, FirstName, Address, City, State,
Zipcode, Phone from Employee where len(ltrim(MiddleName)) = 0"

"momo" <ma***@seeourweb.com> wrote in message
news:uc*************@TK2MSFTNGP05.phx.gbl...
Thank for replying Wayne.

No, I need to retrieve only the records without any MiddleName. I am
looking for blank MiddleNames.

"Wayne" <wa***@nospam.cfwebmasters.com> wrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
Are you sure you don't need to use a LIKE

For Middle Names that begin with:
"Select EmployeeID, SSN, LastName, FirstName, Address, City, State,
Zipcode, Phone from Employee where MiddleName like 'M%' "

For Middle Names that contain (any where)
"Select EmployeeID, SSN, LastName, FirstName, Address, City, State,
Zipcode, Phone from Employee where MiddleName like '%M%' "

For Middle Names that end with...
"Select EmployeeID, SSN, LastName, FirstName, Address, City, State,
Zipcode, Phone from Employee where MiddleName like '%M' "
-Wayne
"momo" <ma***@seeourweb.com> wrote in message
news:uO**************@TK2MSFTNGP04.phx.gbl...
Can someone tell me why my query returns nothing?

"Select EmployeeID, SSN, LastName, FirstName, Address, City, State,
Zipcode, Phone from Employee where MiddleName ='' "

However this works fine.
"Select EmployeeID, SSN, LastName, FirstName, Address, City, State,
Zipcode, Phone from Employee where MiddleName ='M' "

I have checked the Employee table and I have several records with no
value in the MiddleName column.

I am using MS Access'

Please help this is driving me crazy.



May 24 '06 #10
Jeesh!
Try replacing all the empty middle names with space (' '). That HAS to work.

Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"momo" wrote:
Can someone tell me why my query returns nothing?

"Select EmployeeID, SSN, LastName, FirstName, Address, City, State, Zipcode,
Phone from Employee where MiddleName ='' "

However this works fine.
"Select EmployeeID, SSN, LastName, FirstName, Address, City, State, Zipcode,
Phone from Employee where MiddleName ='M' "

I have checked the Employee table and I have several records with no value
in the MiddleName column.

I am using MS Access'

Please help this is driving me crazy.

May 25 '06 #11
Peter Bromberg [C# MVP] <pb*******@yahoo.nospammin.com>'s
wild thoughts were released on Wed, 24 May 2006 18:10:02
-0700 bearing the following fruit:
Jeesh!
Try replacing all the empty middle names with space (' '). That HAS to work.


Yea, but how's he gonna write the WHERE clause for the
UPDATE statment ;-)

LOL.

Jan Hyde (VB MVP)

--
Every morning is the dawn of a new error. (Don Thorn)

May 25 '06 #12
No that will not work for me. So does this mean that there is no way to do
this? It seem so simple.

"Peter Bromberg [C# MVP]" <pb*******@yahoo.nospammin.com> wrote in message
news:F5**********************************@microsof t.com...
Jeesh!
Try replacing all the empty middle names with space (' '). That HAS to
work.

Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"momo" wrote:
Can someone tell me why my query returns nothing?

"Select EmployeeID, SSN, LastName, FirstName, Address, City, State,
Zipcode,
Phone from Employee where MiddleName ='' "

However this works fine.
"Select EmployeeID, SSN, LastName, FirstName, Address, City, State,
Zipcode,
Phone from Employee where MiddleName ='M' "

I have checked the Employee table and I have several records with no
value
in the MiddleName column.

I am using MS Access'

Please help this is driving me crazy.

May 25 '06 #13
"momo" <ma***@seeourweb.com>'s wild thoughts were released
on Thu, 25 May 2006 08:36:19 -0400 bearing the following
fruit:
No that will not work for me. So does this mean that there is no way to do
this? It seem so simple.
It is simple. What your saying just doesn't add up though.

What database are you using?

J
"Peter Bromberg [C# MVP]" <pb*******@yahoo.nospammin.com> wrote in message
news:F5**********************************@microso ft.com...
Jeesh!
Try replacing all the empty middle names with space (' '). That HAS to
work.

Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"momo" wrote:
Can someone tell me why my query returns nothing?

"Select EmployeeID, SSN, LastName, FirstName, Address, City, State,
Zipcode,
Phone from Employee where MiddleName ='' "

However this works fine.
"Select EmployeeID, SSN, LastName, FirstName, Address, City, State,
Zipcode,
Phone from Employee where MiddleName ='M' "

I have checked the Employee table and I have several records with no
value
in the MiddleName column.

I am using MS Access'

Please help this is driving me crazy.

Jan Hyde (VB MVP)

--
A friend of mine just had her 11th baby. Everyone says she's overbearing
(Megan Waves)

May 25 '06 #14
MS Access
"Jan Hyde" <St***********@REMOVE.ME.uboot.com> wrote in message
news:m4********************************@4ax.com...
"momo" <ma***@seeourweb.com>'s wild thoughts were released
on Thu, 25 May 2006 08:36:19 -0400 bearing the following
fruit:
No that will not work for me. So does this mean that there is no way to do
this? It seem so simple.


It is simple. What your saying just doesn't add up though.

What database are you using?

J
"Peter Bromberg [C# MVP]" <pb*******@yahoo.nospammin.com> wrote in message
news:F5**********************************@micros oft.com...
Jeesh!
Try replacing all the empty middle names with space (' '). That HAS to
work.

Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"momo" wrote:

Can someone tell me why my query returns nothing?

"Select EmployeeID, SSN, LastName, FirstName, Address, City, State,
Zipcode,
Phone from Employee where MiddleName ='' "

However this works fine.
"Select EmployeeID, SSN, LastName, FirstName, Address, City, State,
Zipcode,
Phone from Employee where MiddleName ='M' "

I have checked the Employee table and I have several records with no
value
in the MiddleName column.

I am using MS Access'

Please help this is driving me crazy.

Jan Hyde (VB MVP)

--
A friend of mine just had her 11th baby. Everyone says she's overbearing
(Megan Waves)

May 25 '06 #15
"momo" <ma***@seeourweb.com>'s wild thoughts were released
on Thu, 25 May 2006 10:12:05 -0400 bearing the following
fruit:
MS Access

Well I don't know Access but assuming you do, can you
determine if the MiddleName field of the Emplyee table
allows NULL values?

"Jan Hyde" <St***********@REMOVE.ME.uboot.com> wrote in message
news:m4********************************@4ax.com.. .
"momo" <ma***@seeourweb.com>'s wild thoughts were released
on Thu, 25 May 2006 08:36:19 -0400 bearing the following
fruit:
No that will not work for me. So does this mean that there is no way to do
this? It seem so simple.


It is simple. What your saying just doesn't add up though.

What database are you using?

J
"Peter Bromberg [C# MVP]" <pb*******@yahoo.nospammin.com> wrote in message
news:F5**********************************@micro soft.com...
Jeesh!
Try replacing all the empty middle names with space (' '). That HAS to
work.

Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"momo" wrote:

> Can someone tell me why my query returns nothing?
>
> "Select EmployeeID, SSN, LastName, FirstName, Address, City, State,
> Zipcode,
> Phone from Employee where MiddleName ='' "
>
> However this works fine.
> "Select EmployeeID, SSN, LastName, FirstName, Address, City, State,
> Zipcode,
> Phone from Employee where MiddleName ='M' "
>
> I have checked the Employee table and I have several records with no
> value
> in the MiddleName column.
>
> I am using MS Access'
>
> Please help this is driving me crazy.
>
>
>

Jan Hyde (VB MVP)

--
A friend of mine just had her 11th baby. Everyone says she's overbearing
(Megan Waves)

Jan Hyde (VB MVP)

--
Lottery: A tax on people who are bad at math.

May 25 '06 #16
Yes it does and I have tried to use NULL in the statement and it will not
work either.
"Jan Hyde" <St***********@REMOVE.ME.uboot.com> wrote in message
news:ov********************************@4ax.com...
"momo" <ma***@seeourweb.com>'s wild thoughts were released
on Thu, 25 May 2006 10:12:05 -0400 bearing the following
fruit:
MS Access


Well I don't know Access but assuming you do, can you
determine if the MiddleName field of the Emplyee table
allows NULL values?

"Jan Hyde" <St***********@REMOVE.ME.uboot.com> wrote in message
news:m4********************************@4ax.com. ..
"momo" <ma***@seeourweb.com>'s wild thoughts were released
on Thu, 25 May 2006 08:36:19 -0400 bearing the following
fruit:

No that will not work for me. So does this mean that there is no way to
do
this? It seem so simple.

It is simple. What your saying just doesn't add up though.

What database are you using?

J

"Peter Bromberg [C# MVP]" <pb*******@yahoo.nospammin.com> wrote in
message
news:F5**********************************@micr osoft.com...
> Jeesh!
> Try replacing all the empty middle names with space (' '). That HAS to
> work.
>
> Peter
> --
> Co-founder, Eggheadcafe.com developer portal:
> http://www.eggheadcafe.com
> UnBlog:
> http://petesbloggerama.blogspot.com
>
>
>
>
> "momo" wrote:
>
>> Can someone tell me why my query returns nothing?
>>
>> "Select EmployeeID, SSN, LastName, FirstName, Address, City, State,
>> Zipcode,
>> Phone from Employee where MiddleName ='' "
>>
>> However this works fine.
>> "Select EmployeeID, SSN, LastName, FirstName, Address, City, State,
>> Zipcode,
>> Phone from Employee where MiddleName ='M' "
>>
>> I have checked the Employee table and I have several records with no
>> value
>> in the MiddleName column.
>>
>> I am using MS Access'
>>
>> Please help this is driving me crazy.
>>
>>
>>

Jan Hyde (VB MVP)

--
A friend of mine just had her 11th baby. Everyone says she's overbearing
(Megan Waves)

Jan Hyde (VB MVP)

--
Lottery: A tax on people who are bad at math.

May 25 '06 #17
"momo" <ma***@seeourweb.com>'s wild thoughts were released
on Thu, 25 May 2006 11:28:27 -0400 bearing the following
fruit:
Yes it does and I have tried to use NULL in the statement and it will not
work either.
Post the exact SQL you used.

Also, when you say the query returned no rows, how did you
determine this?

J
"Jan Hyde" <St***********@REMOVE.ME.uboot.com> wrote in message
news:ov********************************@4ax.com.. .
"momo" <ma***@seeourweb.com>'s wild thoughts were released
on Thu, 25 May 2006 10:12:05 -0400 bearing the following
fruit:
MS Access


Well I don't know Access but assuming you do, can you
determine if the MiddleName field of the Emplyee table
allows NULL values?

"Jan Hyde" <St***********@REMOVE.ME.uboot.com> wrote in message
news:m4********************************@4ax.com ...
"momo" <ma***@seeourweb.com>'s wild thoughts were released
on Thu, 25 May 2006 08:36:19 -0400 bearing the following
fruit:

>No that will not work for me. So does this mean that there is no way to
>do
>this? It seem so simple.

It is simple. What your saying just doesn't add up though.

What database are you using?

J

>"Peter Bromberg [C# MVP]" <pb*******@yahoo.nospammin.com> wrote in
>message
>news:F5**********************************@mic rosoft.com...
>> Jeesh!
>> Try replacing all the empty middle names with space (' '). That HAS to
>> work.
>>
>> Peter
>> --
>> Co-founder, Eggheadcafe.com developer portal:
>> http://www.eggheadcafe.com
>> UnBlog:
>> http://petesbloggerama.blogspot.com
>>
>>
>>
>>
>> "momo" wrote:
>>
>>> Can someone tell me why my query returns nothing?
>>>
>>> "Select EmployeeID, SSN, LastName, FirstName, Address, City, State,
>>> Zipcode,
>>> Phone from Employee where MiddleName ='' "
>>>
>>> However this works fine.
>>> "Select EmployeeID, SSN, LastName, FirstName, Address, City, State,
>>> Zipcode,
>>> Phone from Employee where MiddleName ='M' "
>>>
>>> I have checked the Employee table and I have several records with no
>>> value
>>> in the MiddleName column.
>>>
>>> I am using MS Access'
>>>
>>> Please help this is driving me crazy.
>>>
>>>
>>>
>
Jan Hyde (VB MVP)

--
A friend of mine just had her 11th baby. Everyone says she's overbearing
(Megan Waves)

Jan Hyde (VB MVP)

--
Lottery: A tax on people who are bad at math.

Jan Hyde (VB MVP)

--
Nostalgia is like a grammar lesson: You find the present tense and the past perfect. (Catherine Shoemaker)

May 26 '06 #18
I have a datagrid to is suppose to display the records found and it does not
display any record when I use

"Select EmployeeID, SSN, LastName, FirstName, Address, City, State, Zipcode,
Phone from Employee where MiddleName =''' '"

But works when I use

"Select EmployeeID, SSN, LastName, FirstName, Address, City, State, Zipcode,
Phone from Employee where MiddleName ='''M''"

Thanks for helping me with this.

Momo.

"Jan Hyde" <St***********@REMOVE.ME.uboot.com> wrote in message
news:2g********************************@4ax.com...
"momo" <ma***@seeourweb.com>'s wild thoughts were released
on Thu, 25 May 2006 11:28:27 -0400 bearing the following
fruit:
Yes it does and I have tried to use NULL in the statement and it will not
work either.


Post the exact SQL you used.

Also, when you say the query returned no rows, how did you
determine this?

J

"Jan Hyde" <St***********@REMOVE.ME.uboot.com> wrote in message
news:ov********************************@4ax.com. ..
"momo" <ma***@seeourweb.com>'s wild thoughts were released
on Thu, 25 May 2006 10:12:05 -0400 bearing the following
fruit:

MS Access
Well I don't know Access but assuming you do, can you
determine if the MiddleName field of the Emplyee table
allows NULL values?
"Jan Hyde" <St***********@REMOVE.ME.uboot.com> wrote in message
news:m4********************************@4ax.co m...
> "momo" <ma***@seeourweb.com>'s wild thoughts were released
> on Thu, 25 May 2006 08:36:19 -0400 bearing the following
> fruit:
>
>>No that will not work for me. So does this mean that there is no way
>>to
>>do
>>this? It seem so simple.
>
> It is simple. What your saying just doesn't add up though.
>
> What database are you using?
>
> J
>
>>"Peter Bromberg [C# MVP]" <pb*******@yahoo.nospammin.com> wrote in
>>message
>>news:F5**********************************@mi crosoft.com...
>>> Jeesh!
>>> Try replacing all the empty middle names with space (' '). That HAS
>>> to
>>> work.
>>>
>>> Peter
>>> --
>>> Co-founder, Eggheadcafe.com developer portal:
>>> http://www.eggheadcafe.com
>>> UnBlog:
>>> http://petesbloggerama.blogspot.com
>>>
>>>
>>>
>>>
>>> "momo" wrote:
>>>
>>>> Can someone tell me why my query returns nothing?
>>>>
>>>> "Select EmployeeID, SSN, LastName, FirstName, Address, City, State,
>>>> Zipcode,
>>>> Phone from Employee where MiddleName ='' "
>>>>
>>>> However this works fine.
>>>> "Select EmployeeID, SSN, LastName, FirstName, Address, City, State,
>>>> Zipcode,
>>>> Phone from Employee where MiddleName ='M' "
>>>>
>>>> I have checked the Employee table and I have several records with
>>>> no
>>>> value
>>>> in the MiddleName column.
>>>>
>>>> I am using MS Access'
>>>>
>>>> Please help this is driving me crazy.
>>>>
>>>>
>>>>
>>
>
>
> Jan Hyde (VB MVP)
>
> --
> A friend of mine just had her 11th baby. Everyone says she's
> overbearing
> (Megan Waves)
>

Jan Hyde (VB MVP)

--
Lottery: A tax on people who are bad at math.

Jan Hyde (VB MVP)

--
Nostalgia is like a grammar lesson: You find the present tense and the
past perfect. (Catherine Shoemaker)

May 26 '06 #19
"momo" <ma***@seeourweb.com>'s wild thoughts were released
on Fri, 26 May 2006 11:20:11 -0400 bearing the following
fruit:
I have a datagrid to is suppose to display the records found and it does not
display any record when I use

"Select EmployeeID, SSN, LastName, FirstName, Address, City, State, Zipcode,
Phone from Employee where MiddleName =''' '"

But works when I use

"Select EmployeeID, SSN, LastName, FirstName, Address, City, State, Zipcode,
Phone from Employee where MiddleName ='''M''"

Thanks for helping me with this.
Then the first thing we need to do is eliminate the SQL as
the cause of the problem. Presumably there is some way you
can pull back results for a given SQL in access itself?

See if you get any results, if you do get results then you
need to post more of your code.

J
Momo.

"Jan Hyde" <St***********@REMOVE.ME.uboot.com> wrote in message
news:2g********************************@4ax.com.. .
"momo" <ma***@seeourweb.com>'s wild thoughts were released
on Thu, 25 May 2006 11:28:27 -0400 bearing the following
fruit:
Yes it does and I have tried to use NULL in the statement and it will not
work either.


Post the exact SQL you used.

Also, when you say the query returned no rows, how did you
determine this?

J

"Jan Hyde" <St***********@REMOVE.ME.uboot.com> wrote in message
news:ov********************************@4ax.com ...
"momo" <ma***@seeourweb.com>'s wild thoughts were released
on Thu, 25 May 2006 10:12:05 -0400 bearing the following
fruit:

>MS Access
>

Well I don't know Access but assuming you do, can you
determine if the MiddleName field of the Emplyee table
allows NULL values?
>"Jan Hyde" <St***********@REMOVE.ME.uboot.com> wrote in message
>news:m4********************************@4ax.c om...
>> "momo" <ma***@seeourweb.com>'s wild thoughts were released
>> on Thu, 25 May 2006 08:36:19 -0400 bearing the following
>> fruit:
>>
>>>No that will not work for me. So does this mean that there is no way
>>>to
>>>do
>>>this? It seem so simple.
>>
>> It is simple. What your saying just doesn't add up though.
>>
>> What database are you using?
>>
>> J
>>
>>>"Peter Bromberg [C# MVP]" <pb*******@yahoo.nospammin.com> wrote in
>>>message
>>>news:F5**********************************@m icrosoft.com...
>>>> Jeesh!
>>>> Try replacing all the empty middle names with space (' '). That HAS
>>>> to
>>>> work.
>>>>
>>>> Peter
>>>> --
>>>> Co-founder, Eggheadcafe.com developer portal:
>>>> http://www.eggheadcafe.com
>>>> UnBlog:
>>>> http://petesbloggerama.blogspot.com
>>>>
>>>>
>>>>
>>>>
>>>> "momo" wrote:
>>>>
>>>>> Can someone tell me why my query returns nothing?
>>>>>
>>>>> "Select EmployeeID, SSN, LastName, FirstName, Address, City, State,
>>>>> Zipcode,
>>>>> Phone from Employee where MiddleName ='' "
>>>>>
>>>>> However this works fine.
>>>>> "Select EmployeeID, SSN, LastName, FirstName, Address, City, State,
>>>>> Zipcode,
>>>>> Phone from Employee where MiddleName ='M' "
>>>>>
>>>>> I have checked the Employee table and I have several records with
>>>>> no
>>>>> value
>>>>> in the MiddleName column.
>>>>>
>>>>> I am using MS Access'
>>>>>
>>>>> Please help this is driving me crazy.
>>>>>
>>>>>
>>>>>
>>>
>>
>>
>> Jan Hyde (VB MVP)
>>
>> --
>> A friend of mine just had her 11th baby. Everyone says she's
>> overbearing
>> (Megan Waves)
>>
>
Jan Hyde (VB MVP)

--
Lottery: A tax on people who are bad at math.

Jan Hyde (VB MVP)

--
Nostalgia is like a grammar lesson: You find the present tense and the
past perfect. (Catherine Shoemaker)

Jan Hyde (VB MVP)

--
Toothache: The pain that drives you to extraction. (Goeff Tibballs)

May 30 '06 #20

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

28
3538
by: Fábio Mendes | last post by:
I'm sorry if it's an replicate. Either my e-mail program is messing with things or the python-list sent my msg to /dev/null. I couldn't find anything related in previous PEP's, so here it goes a...
15
2777
by: Nerox | last post by:
Hi, If i write: #include <stdio.h> int foo(int); int main(void){ int a = 3; foo(a); }
13
2520
by: eman1000 | last post by:
I was recently looking at the prototype library (http://prototype.conio.net/) and I noticed the author used the following syntax: Object.extend(MyObj.prototype, { my_meth1: function(){},...
37
3243
by: Steven Bethard | last post by:
The PEP below should be mostly self explanatory. I'll try to keep the most updated versions available at: http://ucsu.colorado.edu/~bethard/py/pep_create_statement.txt...
18
2682
by: Steven Bethard | last post by:
I've updated the PEP based on a number of comments on comp.lang.python. The most updated versions are still at: http://ucsu.colorado.edu/~bethard/py/pep_create_statement.txt...
28
2905
by: Steven Bethard | last post by:
Ok, I finally have a PEP number. Here's the most updated version of the "make" statement PEP. I'll be posting it shortly to python-dev. Thanks again for the previous discussion and suggestions!...
7
2673
by: Steven Bethard | last post by:
I've updated PEP 359 with a bunch of the recent suggestions. The patch is available at: http://bugs.python.org/1472459 and I've pasted the full text below. I've tried to be more explicit about...
19
8340
by: Steve | last post by:
ASP error number 13 - Type mismatch with SELECT...FOR UPDATE statement I got ASP error number 13 when I use the SELECT...FOR UPDATE statement as below. However, if I use SELECT statement without...
18
7924
by: dspfun | last post by:
Hi! The words "expression" and "statement" are often used in C99 and C- textbooks, however, I am not sure of the clear defintion of these words with respect to C. Can somebody provide a sharp...
23
2040
by: florian.loitsch | last post by:
According to the spec Section 14 the production SourceElements:SourceElements SourceElement is evaluated as follows: 1. Evaluate SourceElements. 2. If Result(1) is an abrupt completion, return...
0
7136
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7182
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6906
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7397
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5490
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3110
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3106
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1430
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
316
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.