Subject Re: Problem with ordering links
Author Marco Menardi <>
Interbase column aliases are very "weak", you can't use them in a
order by clause, you must use column position (i.e. order by 2)
So in ordering items, the ones that IBO uses when builds the "order b
y" clause, must have the column position instead of the alias name, i.e.
instead of
unfortunatly, the automatic orderinglink button create does not do it,
so you have to do it by hand and be carefull when automatically creating.
Marco Menardi

--- In, "Zile" <zilez@p...> wrote:
> When I prepare folowing query:
> select
> dobavljaci.naziv,
> (1-((Sum
> pust)/100)))))*100 as marza,
> count(distinct stavke) as Brojeva,
> Sum(v1.komada) as Komada,
> (v1.komada*( as brcrazlika,
> sum(*v1.komada) as nabavna_vrednost,
Sum(v1.Komada*v1.cena*(1-(v1.Spec_rabat/100))*((100-popust)/100)) as
> Ukupan_promet,
> v1.vrsta
> from dobavljaci
> inner join prodajasviviewNAS v1 on (dobavljaci.vrsta=v1.vrsta)
> where (datum>='01.01.2003' and datum<='11.01.2003') and
(v1.status='R' or
> v1.status='F' or v1.status='O')
> Group by dobavljaci.naziv, v1.vrsta
> Order by 7 descending
> and define ordering items and ordering links with button "Create" in tab
> sheet ordering, and go to tab sheet data, I can prepare query, also
> query, but when I click on column header "Marza" because I want to
> grid by values in this column, I get error:
> Dynamic SQL Error
> SQL Error code = -206
> Column unkonwn
> I use Delphi 6, IBO 4.2 Ib, Interbase, SQL Dialect 1.
> I would very appriciate if someone can help.
> Best Regards
> Zile