Subject | Re: [firebird-support] Re: extract(month from tablename.sendate) |
---|---|
Author | Anderson Farias |
Post date | 2008-10-22T13:04:52Z |
Hi,
<----------- start code ------------->
IBQuery2.SQL.Add( 'select sum(sevkdetail.sevkadeti) as
top_sevki,extract(week from sevkdetail.sevktarihi)as sevk_ayi from
sevkdetail ');
IBQuery2.SQL.Add( 'where sevktarihi>='''+datetostr
(DateTimePicker1.date)+''' AND sevkdetail.sevktarihi<='''+datetostr
(DateTimePicker2.date)+''' ');
IBQuery2.SQL.add('GROUP BY extract(week from
sevkdetail.sevktarihi)' );
<----------- end code ------------->
As far as I can see, I *think* your problem is using a function at your
group by clause, try this instead:
IBQuery2.SQL.add('GROUP BY 2' );
where 2 is the column position of "extract(week from sevkdetail.sevktarihi)"
at your select
Regards,
Anderson Farias
<----------- start code ------------->
IBQuery2.SQL.Add( 'select sum(sevkdetail.sevkadeti) as
top_sevki,extract(week from sevkdetail.sevktarihi)as sevk_ayi from
sevkdetail ');
IBQuery2.SQL.Add( 'where sevktarihi>='''+datetostr
(DateTimePicker1.date)+''' AND sevkdetail.sevktarihi<='''+datetostr
(DateTimePicker2.date)+''' ');
IBQuery2.SQL.add('GROUP BY extract(week from
sevkdetail.sevktarihi)' );
<----------- end code ------------->
As far as I can see, I *think* your problem is using a function at your
group by clause, try this instead:
IBQuery2.SQL.add('GROUP BY 2' );
where 2 is the column position of "extract(week from sevkdetail.sevktarihi)"
at your select
Regards,
Anderson Farias