Page 1 of 1

How query for the date Field

Posted: Wed Mar 21, 2007 8:20 am
by anu_uma
Hi All,

I want to find the details of the payments that are made in the year 2000, 2001 and 2002 from back end - What is the query I have to use.

do i need to take the AP_Checks_All table or the AP_INVOICE_PAYMENTS_ALL ???

Can Any one help me out at the earliest ?

I would like to know the count of the payments made in that particular year.

select * from ap_checks_all, where i am able to see all the payments made from 1996 till date, but I am not able to catch the exact query to find out the details as said above for a particular year.

Posted: Wed Mar 21, 2007 10:11 am
by siva sankar
Hi Uma,

Try for this query,

select* from ap_invoice_payments_all where year in(2000,2001,2002);

Count:

select count(*) from ap_checks_all where sysdate between from_date and to_date;

If any queries please let me know...

Posted: Wed Mar 21, 2007 10:17 am
by ahmadbilal
i dont think sysdate is suiteable check


[quote]Hi Uma,

Try for this query,

select* from ap_invoice_payments_all where year in(2000,2001,2002);

Count:

select count(*) from ap_checks_all where sysdate between from_date and to_date;

If any queries please let me know...


<i><div align="right">Originally posted by siva sankar

Posted: Wed Mar 21, 2007 10:24 am
by admin
Try this one,

SELECT TO_CHAR (check_date, 'YYYY'), COUNT (*)
FROM ap_checks_all
WHERE TO_CHAR (check_date, 'YYYY') IN ('2006', '2007')
GROUP BY TO_CHAR (check_date, 'YYYY')

I am sure you will change the years to your required years. thanks

Posted: Wed Mar 21, 2007 10:29 am
by siva sankar
Hi Uma,

If sysdate is not working fine.
you just put the suitable column name in place of sysdate.

Posted: Thu Jul 10, 2008 11:39 pm
by wenjie
MAYBE THIS QUERY CAN HELP U

SELECT CHK.BANK_ACCOUNT_NAME
,CHK.VENDOR_NAME
,CHK.AMOUNT
,CHK.CHECK_dATE
,INV.INVOICE_NUM
FROM
AP_Checks_V CHK,
AP_INVOICE_PAYMENTS_V INV
WHERE
CHK.CHECK_ID=INV.CHECK_ID
AND TO_CHAR(CHK.CHECK_DATE,'YYYY') IN ('2008','2007')
ORDER BY CHK.CHECK_DATE