Subject | Re: [firebird-support] SQL statment? |
---|---|
Author | Hannes Streicher |
Post date | 2010-02-02T08:11:35Z |
Guten Tag Ahmad $arhan ****,
am Dienstag, 2. Februar 2010 um 08:48 schrieben Sie:
you can do it the following way
select xx ,
sum(iif((StartDate1 >=Table.date) and(Table.Date<EndDate1)),ValuetobeAdded,0),
sum(iif((StartDate2 >=Table.date) and(Table.Date<EndDate2)),ValuetobeAdded,0),
sum(iif((StartDate3 >=Table.date) and(Table.Date<EndDate3)),ValuetobeAdded,0),
sum(iif((StartDate4 >=Table.date) and(Table.Date<EndDate4)),ValuetobeAdded,0)
from table
Mit freundlichen GrĂ¼ssen
Hannes Streicher mailto:HStreicher@...
am Dienstag, 2. Februar 2010 um 08:48 schrieben Sie:
you can do it the following way
select xx ,
sum(iif((StartDate1 >=Table.date) and(Table.Date<EndDate1)),ValuetobeAdded,0),
sum(iif((StartDate2 >=Table.date) and(Table.Date<EndDate2)),ValuetobeAdded,0),
sum(iif((StartDate3 >=Table.date) and(Table.Date<EndDate3)),ValuetobeAdded,0),
sum(iif((StartDate4 >=Table.date) and(Table.Date<EndDate4)),ValuetobeAdded,0)
from table
> hello everybody,--
> I need to know the SQL statment or whatever for retreving summation
> of costs for every month of each account ...how to group it
> the from have 4 boxes, 2 are (from-date) & (to-date) continuoslly
> 2 are (from-account) & (to-account) selective.
> sample:
> 01-01 03-02 05-05 ......etc
> jan
> feb
> mar
> aprl
> may
> jun
> .
> .
> .
> etc
> thanks in advance.
> sarhan
>
> [Non-text portions of this message have been removed]
> ------------------------------------
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> Visit http://www.firebirdsql.org and click the Resources item
> on the main (top) menu. Try Knowledgebase and FAQ links !
> Also search the knowledgebases at http://www.ibphoenix.com
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> Yahoo! Groups Links
Mit freundlichen GrĂ¼ssen
Hannes Streicher mailto:HStreicher@...