Subject Re: Problem with ordering links
Author Marco Menardi <mmenaz@lycosmail.com>
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.
mymarzalabel=2
instead of
mymarzalabel=marza
unfortunatly, the automatic orderinglink button create does not do it,
so you have to do it by hand and be carefull when automatically creating.
regards
Marco Menardi

--- In IBObjects@yahoogroups.com, "Zile" <zilez@p...> wrote:
[cut]
>
> When I prepare folowing query:
>
> select
> dobavljaci.naziv,
> (1-((Sum
>
(v1.komada*(v1.lc)))/(Sum(v1.Komada*v1.cena*(1-(v1.Spec_rabat/100))*((100-po
> pust)/100)))))*100 as marza,
> count(distinct stavke) as Brojeva,
> Sum(v1.komada) as Komada,
>
>
((Sum(v1.Komada*v1.cena*(1-(v1.Spec_rabat/100))*((100-popust)/100)))-(Sum
> (v1.komada*(v1.lc)))) as brcrazlika,
> sum(v1.lc*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
activate
> query, but when I click on column header "Marza" because I want to
reorder
> grid by values in this column, I get error:
>
> Dynamic SQL Error
> SQL Error code = -206
> Column unkonwn
> MARZA
>
> I use Delphi 6, IBO 4.2 Ib, Interbase 6.0.1.6, SQL Dialect 1.
>
> I would very appriciate if someone can help.
>
> Best Regards
>
> Zile