|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
What's wrong with this queryselect 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. 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. > > 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. >> >> > > Henry Jones wrote:
Show quote > use northwind Where are you executing this? Query Analyzer? Management Studio? Some > > 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. > > other client? |
|||||||||||||||||||||||