>Thanks Naomi,
>
>At this line
>
>
>round(sum(amount)/iif(sum(weight)=0, null, sum(weight)),2) as kgrt
>
>
>it says:
>
>Msg 102, Level 15, State 1, Line 2
>Incorrect syntax near '='.
>Msg 156, Level 15, State 1, Line 9
>Incorrect syntax near the keyword 'as'.
Are you running in SQL Server or VFP? If the forner, what is your SQL Server version?
Also, looks like I missed one ), e.g. it should be
round(sum(amount)/iif(sum(weight)=0, null, sum(weight))),2) as kgrt
If it's not broken, fix it until it is.
My Blog