TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
John Hammond
NA
16
8.9k
SQL statements Fiscal Year(July 01 -June 30)
Apr 28 2016 1:37 PM
SELECT *
FROM tippertable
WHERE TRUNC (DT) >=
TO_DATE(:decalyear, 'mm/yyyy')
and TRUNC (DT) <
add_months(TO_DATE(:decalyear, 'mm/yyyy'), 1)
and acc_missed IS NOT NULL
ORDER BY DT
I have a drop-down
list of month and year called (decal year) in it I have: April 2016,March 2016 down all the way to April 2015.when let say March 2016 is selected and run it gives me all the month of March .
Next If i run the below sql statement for the fiscal year(July 01- june 30) i will get my dates from 7/1/2015 -4/28/2016.
SELECT *
FROM tippertable
WHERE TRUNC (DT) >=(CASE
WHEN TO_NUMBER (TO_CHAR (SYSDATE, 'MM')) > 6
THEN
ADD_MONTHS (TRUNC (SYSDATE, 'YYYY'),1)
ELSE
ADD_MONTHS (TRUNC (SYSDATE, 'YYYY'),(TO_NUMBER (TO_CHAR (SYSDATE, 'MM')) -10))
END)
and acc_missed IS NOT NULL
ORDER BY DT
Now my question is how can i insert the decalyear: prompt to run my fiscal year sql statement when a month and year is selected from the drop-down. Thanks very much John
Reply
Answers (
1
)
Indexes on Table
EMI calculations