Subject | Re: [firebird-support] Re: extract(month from tablename.sendate) |
---|---|
Author | Anderson Farias |
Post date | 2008-10-22T13:33:41Z |
> As far as I can see, I *think* your problem is using a function at yourHummmm... not really... I've tested here under 2.1 and there's no problem at
> group by clause, try this instead:
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