Subject Re: [firebird-support] Re: extract(month from tablename.sendate)
Author Anderson Farias
> As far as I can see, I *think* your problem is using a function at your
> group by clause, try this instead:

Hummmm... not really... I've tested here under 2.1 and there's no problem at
all. So, forget it.


First try the SQL direct on some Tool like flamerobin, if it works than the
problem must be when you add strings to your Query.SQL

try this:

with IBQuery2 do
begin
Close;
SQL.Clear;
SQL.Add( 'select sum(sevkdetail.sevkadeti) as top_sevki, ');
SQL.Add( 'extract(week from sevkdetail.sevktarihi)as sevk_ayi ');
SQL.Add( 'from sevkdetail ');
SQL.Add( format('where sevktarihi>=%s', [QuoteStr(datetostr
(DateTimePicker1.date))]) );
SQL.Add( format('AND sevkdetail.sevktarihi<=%s', [QuoteStr(datetostr
(DateTimePicker2.date))]) );
SQL.Add( 'GROUP BY extract(week from sevkdetail.sevktarihi)' );
open;
end;


HTH

Regards,
Anderson Farias