Home All Groups Group Topic Archive Search About

What's wrong with this query

Author
18 Aug 2006 7:27 PM
Henry Jones
use northwind

select o.orderID, o.employeeID. o.customerID, o.orderdate

from dbo.orders AS O

join (select employeeID, max(orderid) as Maxoid

from dbo.orders

group by employeeID) as D

ON o.orderid = d.maxoid;





-------------------------------------------------

error generated:



Msg 258, Level 15, State 1, Line 3

Cannot call methods on int.

Author
18 Aug 2006 7:42 PM
Tom Cooper
Not sure this is causing your problem, but you have a period where you
should have a comma in the after o.employeeID in the select clause.

Tom

Show quote
"Henry Jones" <henryjo***@yada.com> wrote in message
news:OZJ7QxvwGHA.4688@TK2MSFTNGP06.phx.gbl...
> use northwind
>
> select o.orderID, o.employeeID. o.customerID, o.orderdate
>
> from dbo.orders AS O
>
> join (select employeeID, max(orderid) as Maxoid
>
> from dbo.orders
>
> group by employeeID) as D
>
> ON o.orderid = d.maxoid;
>
>
>
>
>
> -------------------------------------------------
>
> error generated:
>
>
>
> Msg 258, Level 15, State 1, Line 3
>
> Cannot call methods on int.
>
>
Author
18 Aug 2006 7:48 PM
Henry Jones
Thanks Tom for the other set of eyes.  Sometimes you can stare code in the
face and miss the simple stuff.

H


Show quote
"Tom Cooper" <tom.no.spam.please.cooper@comcast.net> wrote in message
news:zt6dnWuthJqZhXvZnZ2dnUVZ_tydnZ2d@comcast.com...
> Not sure this is causing your problem, but you have a period where you
> should have a comma in the after o.employeeID in the select clause.
>
> Tom
>
> "Henry Jones" <henryjo***@yada.com> wrote in message
> news:OZJ7QxvwGHA.4688@TK2MSFTNGP06.phx.gbl...
>> use northwind
>>
>> select o.orderID, o.employeeID. o.customerID, o.orderdate
>>
>> from dbo.orders AS O
>>
>> join (select employeeID, max(orderid) as Maxoid
>>
>> from dbo.orders
>>
>> group by employeeID) as D
>>
>> ON o.orderid = d.maxoid;
>>
>>
>>
>>
>>
>> -------------------------------------------------
>>
>> error generated:
>>
>>
>>
>> Msg 258, Level 15, State 1, Line 3
>>
>> Cannot call methods on int.
>>
>>
>
>
Author
18 Aug 2006 7:46 PM
Tracy McKibben
Henry Jones wrote:
Show quote
> use northwind
>
> select o.orderID, o.employeeID. o.customerID, o.orderdate
>
> from dbo.orders AS O
>
> join (select employeeID, max(orderid) as Maxoid
>
> from dbo.orders
>
> group by employeeID) as D
>
> ON o.orderid = d.maxoid;
>
>
>
>
>
> -------------------------------------------------
>
> error generated:
>
>
>
> Msg 258, Level 15, State 1, Line 3
>
> Cannot call methods on int.
>
>

Where are you executing this?  Query Analyzer?  Management Studio?  Some
other client?


--
Tracy McKibben
MCDBA
http://www.realsqlguy.com

AddThis Social Bookmark Button