Unix Technical Forum

An expression of non-boolean type specified in a context where a condition is expected, near ')'.

This is a discussion on An expression of non-boolean type specified in a context where a condition is expected, near ')'. within the SQL Server forums, part of the Microsoft SQL Server category; --> Hi, I am trying to create an update statement on a table with a foreign key to the Users ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > SQL Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-01-2008, 02:39 PM
pbd22
 
Posts: n/a
Default An expression of non-boolean type specified in a context where a condition is expected, near ')'.


Hi,

I am trying to create an update statement
on a table with a foreign key to the Users
table (userid).

I am getting the error:

An expression of non-boolean type specified in a context where a
condition is expected, near ')'.

Below is the Update statement.

UPDATE LastLogin SET
date = '2007-08-14 05:34:09.910',
status = 1 ,
activity = 0
WHERE
(SELECT ll.status, ll.activity, ll.date
FROM LastLogin ll, Users u
WHERE ll.userid = u.userid
AND u.email = 'dushkin@hotmail.com')

Thanks!

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 03-01-2008, 02:40 PM
Roy Harvey
 
Posts: n/a
Default Re: An expression of non-boolean type specified in a context where a condition is expected, near ')'.

It looks like you are trying to use a correated subquery without the
correlation, and without either the IN or EXISTS that makes use of
such a subquery. Perhaps this will give you some ideas.

UPDATE LastLogin
SET date = '2007-08-14 05:34:09.910',
status = 1,
activity = 0
WHERE EXISTS
(SELECT *
FROM Users u
WHERE LastLogin.userid = u.userid
AND u.email = 'dushkin@hotmail.com')

Roy Harvey
Beacon Falls, CT

On Mon, 20 Aug 2007 13:10:56 -0700, pbd22 <dushkin@gmail.com> wrote:

>
>Hi,
>
>I am trying to create an update statement
>on a table with a foreign key to the Users
>table (userid).
>
>I am getting the error:
>
>An expression of non-boolean type specified in a context where a
>condition is expected, near ')'.
>
>Below is the Update statement.
>
>UPDATE LastLogin SET
> date = '2007-08-14 05:34:09.910',
> status = 1 ,
> activity = 0
>WHERE
>(SELECT ll.status, ll.activity, ll.date
> FROM LastLogin ll, Users u
> WHERE ll.userid = u.userid
> AND u.email = 'dushkin@hotmail.com')
>
>Thanks!

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 03-01-2008, 02:40 PM
pbd22
 
Posts: n/a
Default Re: An expression of non-boolean type specified in a context where a condition is expected, near ')'.

On Aug 20, 1:47 pm, Roy Harvey <roy_har...@snet.net> wrote:
> It looks like you are trying to use a correated subquery without the
> correlation, and without either the IN or EXISTS that makes use of
> such a subquery. Perhaps this will give you some ideas.
>
> UPDATE LastLogin
> SET date = '2007-08-14 05:34:09.910',
> status = 1,
> activity = 0
> WHERE EXISTS
> (SELECT *
> FROM Users u
> WHERE LastLogin.userid = u.userid
> AND u.email = 'dush...@hotmail.com')
>
> Roy Harvey
> Beacon Falls, CT
>
> On Mon, 20 Aug 2007 13:10:56 -0700, pbd22 <dush...@gmail.com> wrote:
>
> >Hi,

>
> >I am trying to create an update statement
> >on a table with a foreign key to the Users
> >table (userid).

>
> >I am getting the error:

>
> >An expression of non-boolean type specified in a context where a
> >condition is expected, near ')'.

>
> >Below is the Update statement.

>
> >UPDATE LastLogin SET
> > date = '2007-08-14 05:34:09.910',
> > status = 1 ,
> > activity = 0
> >WHERE
> >(SELECT ll.status, ll.activity, ll.date
> > FROM LastLogin ll, Users u
> > WHERE ll.userid = u.userid
> > AND u.email = 'dush...@hotmail.com')

>
> >Thanks!


Thanks, that helped.
Nice to see somebody local.

Peter
New Haven, CT

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:01 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com