Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Database Results Error

Status
Not open for further replies.

dhesser

Programmer
Aug 16, 2006
2
US
I've got a Group By query set up as a view in MySQL. The query/view works fine when run from MySQL, but gives the following error when incorporated as a result set in a FrontPage web page I've published:
"Database Results Error
Description: Multiple-step operation generated errors. Check each status value.
Number: -2147217887 (0x80040E21)
Source: Microsoft Cursor Engine"

The query looks like:

#SELECT p.plast as 'Player Last', p.pfirst as 'Player #First', DATE_FORMAT(e.date, '%c-%e-%Y') as 'Date',
#date_format(e.begin, '%l:%i %p') as 'Start', o_Opponent, #t.edescr as 'Description', sum(s.pmin) as 'Play Min',
# sum(case e.etype_id
# when 1 then 70-s.pmin
# when 2 then null
# when 3 then 60-s.pmin
# when 4 then 60-s.pmin
# end) as 'Bench Min',
# sum(s.Goals) as 'Goals', sum(s.Assists) as 'Assists', sum
#(s.ycards) as 'Yellow Cards', sum(s.rcards) as 'Red Cards'
#FROM event e
#join etype t on e.etype_id = t.etype_id
#join opponents o on e.opponent_id = o.opponent_id
#join stats s on e.e_id = s.e_id
#right join players p on p.player_id = s.player_id
#where e.etype_id != 2
#group by p.plast, p.pfirst
#order by p.plast, p.pfirst, e.date, e.begin;

I'm sure it has something to do with the CASE statement inside the SUM function, but I'm not sure why it works in MySQL, but not FronTPage.

If it helps, what I'm trying to do is calculate a column based on another column (Bench Minutes = X - Play Minutes) where the value of X is based on etype_id and then present the sum of that column with the sums of the other columns in a row for an individual.

Any suggestions would be greatly appreciated!

Thanks in advance!
Dale
 
Update:
It appears it has nothing to do with the CASE statement but the use of GROUP BY and/or the aggregate SUM function. I've simplified the query to the following and still receive the error.

SELECT
p.plast as 'Player Last',
p.pfirst as 'Player First',
sum(s.pmin),
sum(s.Goals),
sum(s.Assists),
sum(s.ycards),
sum(s.rcards)
FROM players p
join stats s on p.player_id = s.player_id
group by p.plast
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top