Click here to Skip to main content
16,005,141 members
Home / Discussions / Database
   

Database

 
AnswerRe: Open "Edit" form based on SQL item? Pin
Colin Angus Mackay27-Jun-06 4:33
Colin Angus Mackay27-Jun-06 4:33 
GeneralRe: Open "Edit" form based on SQL item? Pin
PyroManiak27-Jun-06 6:11
PyroManiak27-Jun-06 6:11 
GeneralRe: Open "Edit" form based on SQL item? Pin
Colin Angus Mackay27-Jun-06 12:27
Colin Angus Mackay27-Jun-06 12:27 
AnswerRe: Open "Edit" form based on SQL item? Pin
Colin Angus Mackay27-Jun-06 12:47
Colin Angus Mackay27-Jun-06 12:47 
GeneralRe: Open "Edit" form based on SQL item? Pin
PyroManiak27-Jun-06 12:58
PyroManiak27-Jun-06 12:58 
GeneralRe: Open "Edit" form based on SQL item? Pin
PyroManiak27-Jun-06 13:08
PyroManiak27-Jun-06 13:08 
GeneralRe: Open "Edit" form based on SQL item? Pin
Colin Angus Mackay27-Jun-06 13:27
Colin Angus Mackay27-Jun-06 13:27 
QuestionSQL Server Function Call [modified] Pin
tadhg8826-Jun-06 3:16
tadhg8826-Jun-06 3:16 
Hi i am having trouble tryin to call a function 4 times in the same statement but with different parameters this is the function

CREATE FUNCTION [dbo].[pr_bll_GetGoalkeeperMarks]
(@PlayerID int,
@Ability nvarchar(120)) returns int
--WITH ENCRYPTION
BEGIN
DECLARE @result int
select @result = case @Ability
WHEN 'Athletic' THEN ScoutingGoalkeeperAthleticAbility.Agility+ScoutingGoalkeeperAthleticAbility.Reactions+ScoutingGoalkeeperAthleticAbility.Bodystrength --Athletic
WHEN 'Character' THEN ScoutingGoalkeeperCharacter.Confidence+ScoutingGoalkeeperCharacter.Bravery+ScoutingGoalkeeperCharacter.Leadership+ScoutingGoalkeeperCharacter.Energetic+ScoutingGoalkeeperCharacter.RiskTaker+ScoutingGoalkeeperCharacter.Talkative+ScoutingGoalkeeperCharacter.Competitive+ScoutingGoalkeeperCharacter.Presence --Character
WHEN 'Tactical' THEN ScoutingGoalkeeperTacticalAbility.Vision+ScoutingGoalkeeperTacticalAbility.Awareness+ScoutingGoalkeeperTacticalAbility.Anticipation+ScoutingGoalkeeperTacticalAbility.StartingPosition --Tactical
WHEN 'Technical' THEN ScoutingGoalkeeperTechnicalAbility.Handling+ScoutingGoalkeeperTechnicalAbility.Crosses+ScoutingGoalkeeperTechnicalAbility.ShotStopping+ScoutingGoalkeeperTechnicalAbility.KickingDeadBall+ScoutingGoalkeeperTechnicalAbility.KickingHands+ScoutingGoalkeeperTechnicalAbility.Distribution+ScoutingGoalkeeperTechnicalAbility.BackPasses+ScoutingGoalkeeperTechnicalAbility.Positioning+ScoutingGoalkeeperTechnicalAbility.CommandOfArea+ScoutingGoalkeeperTechnicalAbility.Sweeping+ScoutingGoalkeeperTechnicalAbility.ComingOffLine --Technical
end
from
ScoutingReport sr
Join Person p on p.Id = sr.ScoutID
left join ScoutingDefenderTechnicalAbility on ScoutingDefenderTechnicalAbility.ScoutingReportID = sr.Id
left join ScoutingForwardTechnicalAbility on ScoutingForwardTechnicalAbility.ScoutingReportID = sr.Id
left join ScoutingGoalkeeperAthleticAbility on ScoutingGoalkeeperAthleticAbility.ScoutingReportID = sr.Id
left join ScoutingGoalkeeperCharacter on ScoutingGoalkeeperCharacter.ScoutingReportID = sr.Id
left join ScoutingGoalkeeperTacticalAbility on ScoutingGoalkeeperTacticalAbility.ScoutingReportID = sr.Id
left join ScoutingGoalkeeperTechnicalAbility on ScoutingGoalkeeperTechnicalAbility.ScoutingReportID = sr.Id
left join ScoutingMidfielderTechnicalAbility on ScoutingMidfielderTechnicalAbility.ScoutingReportID = sr.Id
left join ScoutingOutfieldAthleticAbility on ScoutingOutfieldAthleticAbility.ScoutingReportID = sr.Id
left join ScoutingOutfieldCharacter on ScoutingOutfieldCharacter.ScoutingReportID = sr.Id
left join ScoutingOutfieldTacticalAbility on ScoutingOutfieldTacticalAbility.ScoutingReportID = sr.Id
where
sr.ScoutedPersonId = @PlayerId and
sr.type=0
return @result
END

playerid and ability parameters are passed in and a count of that ability for that player is passed back it works fine when the statement doesnt try to get the average of each ability but when this is included the results are the same for each of the four calls im just wondering if anyone has any idea why this is happenin thanks in advance

select avg(dbo.pr_bll_GetGoalkeeperMarks(scoutedPersonID, 'Athletic')) as 'Athletic',
avg(dbo.pr_bll_GetGoalkeeperMarks(scoutedPersonID, 'Character')) as 'Character',
avg(dbo.pr_bll_GetGoalkeeperMarks(scoutedPersonID, 'Tactical')) as 'Tactical',
avg(dbo.pr_bll_GetGoalkeeperMarks(scoutedPersonID, 'Technical')) as 'Technical',
avg(dbo.pr_bll_GetPlayerTotalMarks(scoutedPersonID))
from scoutingreport sr
Where sr.type = 0
And ScoutId = 11619
And sr.Position in (Select ID From ScoutingPosition Where PositionGroup = 0)

-- modified at 6:45 Wednesday 28th June, 2006
AnswerOT Pin
Colin Angus Mackay27-Jun-06 4:37
Colin Angus Mackay27-Jun-06 4:37 
GeneralRe: OT Pin
tadhg8827-Jun-06 5:06
tadhg8827-Jun-06 5:06 
GeneralRe: OT Pin
Colin Angus Mackay27-Jun-06 5:12
Colin Angus Mackay27-Jun-06 5:12 
GeneralRe: OT Pin
tadhg8827-Jun-06 6:00
tadhg8827-Jun-06 6:00 
GeneralRe: OT Pin
Eric Dahlvang27-Jun-06 9:19
Eric Dahlvang27-Jun-06 9:19 
GeneralRe: OT Pin
Colin Angus Mackay27-Jun-06 12:25
Colin Angus Mackay27-Jun-06 12:25 
GeneralRe: OT Pin
tadhg8828-Jun-06 0:01
tadhg8828-Jun-06 0:01 
QuestionRe: SQL Server Function Call Pin
Eric Dahlvang27-Jun-06 9:13
Eric Dahlvang27-Jun-06 9:13 
AnswerRe: SQL Server Function Call Pin
tadhg8828-Jun-06 0:44
tadhg8828-Jun-06 0:44 
GeneralRe: SQL Server Function Call Pin
Eric Dahlvang28-Jun-06 4:02
Eric Dahlvang28-Jun-06 4:02 
GeneralRe: SQL Server Function Call Pin
tadhg8828-Jun-06 5:48
tadhg8828-Jun-06 5:48 
GeneralRe: SQL Server Function Call Pin
Eric Dahlvang28-Jun-06 5:59
Eric Dahlvang28-Jun-06 5:59 
GeneralRe: SQL Server Function Call Pin
tadhg8829-Jun-06 4:10
tadhg8829-Jun-06 4:10 
QuestionStored procedure, urgent help [modified] Pin
Naveed Kamboh26-Jun-06 1:08
Naveed Kamboh26-Jun-06 1:08 
AnswerRe: Stored procedure, urgent help Pin
Paul Conrad26-Jun-06 18:32
professionalPaul Conrad26-Jun-06 18:32 
QuestionStored Procedure and Image Pin
Monty225-Jun-06 21:44
Monty225-Jun-06 21:44 
AnswerRe: Stored Procedure and Image Pin
Mike Dimmick26-Jun-06 2:04
Mike Dimmick26-Jun-06 2:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.