Subject R: [ib-support] UDF: Month and year
Author Paolo Fainelli
As Luiz Alves said to me ....

1) build a view on table baddebtorstatproc:

CREATE VIEW v_baddebtorstatproc(
indate,
month_indate,
year_indate,
proccode
) AS SELECT indate,
extract(month from baddebtorstatproc.indate),
extract(year from baddebtorstatproc.indate),
proccode

from baddebtorstatproc

2) change your query in:

select
count(indate), month_indate, year_indate from
v_baddebtorstatproc
where
(proccode in ('INVT' ,'CWEB'))
group by
indate,month_indate, year_indate

3) ready to go!

Paolo

----- Original Message -----
From: Morné Owen (PQ Africa)
To: ib-support@yahoogroups.com
Sent: Tuesday, July 03, 2001 1:42 PM
Subject: [ib-support] UDF: Month and year


Hi

I need to group records by month and year based on a timestamp (InDate in
the example). Tried the following example but receive a "token unknown"
error:

select
count(indate), indate, month(indate), year(indate)
from
baddebtorstatproc
where
(proccode in ('INVT' ,'CWEB'))
group by
indate, month(indate), year(indate)


I need to count how many records found for a specific month and year.

Any help greatly appreciated.


Morné

http://www.activesms.co.za?sponsor=270829284115


[Non-text portions of this message have been removed]


To unsubscribe from this group, send an email to:
ib-support-unsubscribe@egroups.com



Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.