Subject | Re: extract(month from tablename.sendate) |
---|---|
Author | dirinler |
Post date | 2008-10-23T08:42:30Z |
Thank you for you interese anderson but if i use 'extract(month from
sevkdetail.sevktarihi)as sevk_ayi ' this is ok
but when i use this code with week it says this error
project project2.exe raised exception class EIBInterBaseError with
message 'Dynamic SQL Error SQL error code=-104 token unknown-line
2,column 9 week'.
:((
--- In firebird-support@yahoogroups.com, "Anderson Farias"
<peixedragao@...> wrote:
sevkdetail.sevktarihi)as sevk_ayi ' this is ok
but when i use this code with week it says this error
project project2.exe raised exception class EIBInterBaseError with
message 'Dynamic SQL Error SQL error code=-104 token unknown-line
2,column 9 week'.
:((
--- In firebird-support@yahoogroups.com, "Anderson Farias"
<peixedragao@...> wrote:
>at your
> > As far as I can see, I *think* your problem is using a function
> > group by clause, try this instead:problem at
>
> Hummmm... not really... I've tested here under 2.1 and there's no
> all. So, forget it.than the
>
>
> First try the SQL direct on some Tool like flamerobin, if it works
> problem must be when you add strings to your Query.SQL(datetostr
>
> 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
> (DateTimePicker2.date))]) );
> SQL.Add( 'GROUP BY extract(week from sevkdetail.sevktarihi)' );
> open;
> end;
>
>
> HTH
>
> Regards,
> Anderson Farias
>