Subject | Re: [IBO] Re: Error in calculations SQL |
---|---|
Author | Helen Borrie |
Post date | 2007-01-17T08:03:56Z |
At 06:40 PM 17/01/2007, you wrote:
Either clear the KeyLinks entirely and set AutoDefineKeylinks false,
or use this:
SELECT
AnoAlbaran,
SerieAlbaran,
idAlbaran,
sum(coalesce(Precio, 0) * coalesce(Cantidad, 1) *
(100-coalesce(Descuento, 0))/100)*1.16 as TotalAlbaran
FROM LinAlbaranes
WHERE AnoAlbaran=2007 and SerieAlbaran=0 and idAlbaran=36
group by 1, 2, 3
and set Keylinks to
AnoAlbaran
SerieAlbaran
idAlbaran
Helen
>When I execute select:Of course it is invalid. It is not in the output set.
>
>SELECT sum(coalesce(Precio, 0) * coalesce(Cantidad, 1) *
>(100-coalesce(Descuento, 0))/100)*1.16 as TotalAlbaran
>FROM LinAlbaranes
>WHERE AnoAlbaran=2007 and SerieAlbaran=0 and idAlbaran=36
>
>it gives back the error to me "Invalid KeyLinks entry:
>LINALBARANES.ANOALBARAN"
Either clear the KeyLinks entirely and set AutoDefineKeylinks false,
or use this:
SELECT
AnoAlbaran,
SerieAlbaran,
idAlbaran,
sum(coalesce(Precio, 0) * coalesce(Cantidad, 1) *
(100-coalesce(Descuento, 0))/100)*1.16 as TotalAlbaran
FROM LinAlbaranes
WHERE AnoAlbaran=2007 and SerieAlbaran=0 and idAlbaran=36
group by 1, 2, 3
and set Keylinks to
AnoAlbaran
SerieAlbaran
idAlbaran
Helen