July 13, 2006 at 11:49 am
I need to migrate a query from Access to SQL Server: ok I got this:
IN ACCESS:
Sum(([MVG T003 - Eliminate outliers from T001]![CurMileage]-[CPM T001 - Calc avg cur mileage & proceeds]![AvgOfCurMileage])^2) AS [Reg Equation Slope Denomator]
I MODIFY IT TO SQL like this, BUT it's not working, I mean work but do not give the same result as Access
SQUARE(Sum(([MVG T003 - Eliminate outliers from T001].[CurMileage]-[CPM T001 - Calc avg cur mileage & proceeds].[AvgOfCurMileage]))) AS [Reg Equation Slope Denomator]
any Ideas???
thank you
July 13, 2006 at 11:56 am
looks like the sum and square are the wrong way round i.e. sum of the squares and square of the sum...
In access you have
sum(([cur]-[avg])^2)
and in sql you have
square(sum([cur]-[avg]))
try
sum(square([cur]-[avg])) instead.
July 13, 2006 at 12:04 pm
I love you man, works, Thanks alor
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply