How query for the date Field

In this forum you can share stuff related to Oracle 11g, 10g, 9i.
Post Reply
anu_uma
Posts: 456
Joined: Sat Feb 03, 2007 4:39 am
Location: India
Contact:

How query for the date Field

Post 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.
siva sankar
Posts: 130
Joined: Sun Mar 11, 2007 1:47 am
Location: India

Post 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...
ahmadbilal
Posts: 615
Joined: Mon Sep 18, 2006 1:32 am
Location: United Arab Emirates
Contact:

Post 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
admin
Posts: 2063
Joined: Fri Mar 31, 2006 12:59 am
Location: Pakistan
Contact:

Post 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
siva sankar
Posts: 130
Joined: Sun Mar 11, 2007 1:47 am
Location: India

Post by siva sankar »

Hi Uma,

If sysdate is not working fine.
you just put the suitable column name in place of sysdate.
wenjie
Posts: 30
Joined: Mon Jul 07, 2008 5:42 am
Location: Indonesia

Post 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
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests