Query : To Check whether Periods of AP/AR/GL/FA/PO is closed?
SELECT (SELECT sob.NAME
FROM gl.gl_sets_of_books sob
WHERE sob.set_of_books_id = a.set_of_books_id) "SOB_Name",
a.period_name "Period_Name", a.period_num "Period_Num",
a.gl_status "GL_Status", b.po_status "PO_Status",
c.ap_status "AP_Status", d.ar_status "AR_Status",
e.fa_status "FA_Status"
FROM (SELECT period_name, period_num,
DECODE (closing_status,
'O', 'Open',
'C', 'Closed',
'F', 'Future',
'N', 'Never',
closing_status
) gl_status,
set_of_books_id
FROM gl.gl_period_statuses
WHERE application_id = 101
AND UPPER (period_name) = UPPER ('&period_name')
AND set_of_books_id ='&sob' ) a,
(SELECT period_name,
DECODE (closing_status,
'O', 'Open',
'C', 'Closed',
'F', 'Future',
'N', 'Never',
closing_status
) po_status,set_of_books_id
FROM gl.gl_period_statuses
WHERE application_id = 201
AND UPPER (period_name) = UPPER ('&period_name')
AND set_of_books_id ='&sob' ) b,
(SELECT period_name,
DECODE (closing_status,
'O', 'Open',
'C', 'Closed',
'F', 'Future',
'N', 'Never',
closing_status
) ap_status,set_of_books_id
FROM gl.gl_period_statuses
WHERE application_id = 200
AND UPPER (period_name) = UPPER ('&period_name')
AND set_of_books_id ='&sob' ) c,
(SELECT period_name,
DECODE (closing_status,
'O', 'Open',
'C', 'Closed',
'F', 'Future',
'N', 'Never',
closing_status
) ar_status,set_of_books_id
FROM gl.gl_period_statuses
WHERE application_id = 222
AND UPPER (period_name) = UPPER ('&period_name')
AND set_of_books_id ='&sob') d,
(SELECT fdp.period_name,
DECODE (fdp.period_close_date,
NULL, 'Open',
'Closed'
) fa_status,fbc.set_of_books_id
FROM fa.fa_book_controls fbc, fa.fa_deprn_periods fdp
WHERE fbc.set_of_books_id ='&sob'
AND fbc.book_type_code = fdp.book_type_code
AND UPPER (fdp.period_name) = UPPER ('&period_name')) e
WHERE a.period_name = b.period_name(+)
AND a.period_name = c.period_name(+)
AND a.period_name = d.period_name(+)
AND a.period_name = e.period_name(+)
AND a.set_of_books_id=b.set_of_books_id(+)
and a.set_of_books_id=c.set_of_books_id(+)
and a.set_of_books_id=d.set_of_books_id(+)
and a.set_of_books_id=e.set_of_books_id(+)
ORDER BY 1
FROM gl.gl_sets_of_books sob
WHERE sob.set_of_books_id = a.set_of_books_id) "SOB_Name",
a.period_name "Period_Name", a.period_num "Period_Num",
a.gl_status "GL_Status", b.po_status "PO_Status",
c.ap_status "AP_Status", d.ar_status "AR_Status",
e.fa_status "FA_Status"
FROM (SELECT period_name, period_num,
DECODE (closing_status,
'O', 'Open',
'C', 'Closed',
'F', 'Future',
'N', 'Never',
closing_status
) gl_status,
set_of_books_id
FROM gl.gl_period_statuses
WHERE application_id = 101
AND UPPER (period_name) = UPPER ('&period_name')
AND set_of_books_id ='&sob' ) a,
(SELECT period_name,
DECODE (closing_status,
'O', 'Open',
'C', 'Closed',
'F', 'Future',
'N', 'Never',
closing_status
) po_status,set_of_books_id
FROM gl.gl_period_statuses
WHERE application_id = 201
AND UPPER (period_name) = UPPER ('&period_name')
AND set_of_books_id ='&sob' ) b,
(SELECT period_name,
DECODE (closing_status,
'O', 'Open',
'C', 'Closed',
'F', 'Future',
'N', 'Never',
closing_status
) ap_status,set_of_books_id
FROM gl.gl_period_statuses
WHERE application_id = 200
AND UPPER (period_name) = UPPER ('&period_name')
AND set_of_books_id ='&sob' ) c,
(SELECT period_name,
DECODE (closing_status,
'O', 'Open',
'C', 'Closed',
'F', 'Future',
'N', 'Never',
closing_status
) ar_status,set_of_books_id
FROM gl.gl_period_statuses
WHERE application_id = 222
AND UPPER (period_name) = UPPER ('&period_name')
AND set_of_books_id ='&sob') d,
(SELECT fdp.period_name,
DECODE (fdp.period_close_date,
NULL, 'Open',
'Closed'
) fa_status,fbc.set_of_books_id
FROM fa.fa_book_controls fbc, fa.fa_deprn_periods fdp
WHERE fbc.set_of_books_id ='&sob'
AND fbc.book_type_code = fdp.book_type_code
AND UPPER (fdp.period_name) = UPPER ('&period_name')) e
WHERE a.period_name = b.period_name(+)
AND a.period_name = c.period_name(+)
AND a.period_name = d.period_name(+)
AND a.period_name = e.period_name(+)
AND a.set_of_books_id=b.set_of_books_id(+)
and a.set_of_books_id=c.set_of_books_id(+)
and a.set_of_books_id=d.set_of_books_id(+)
and a.set_of_books_id=e.set_of_books_id(+)
ORDER BY 1
30 comments:
You are missing a DISTINCT clause for those using multiple period_names.
select set_of_books_id, period_name, period_num, max(gl_status) gl_status, max(po_status) po_status, max(ap_status) ap_status, max(ar_status)
from (
select set_of_books_id, period_name, period_num,
decode (application_id, 101, closing_status) gl_status,
decode (application_id, 201, closing_status) po_status,
decode (application_id, 200, closing_status) ap_status,
decode (application_id, 222, closing_status) ar_status
from (select set_of_books_id, application_id, period_name, period_num,
decode (closing_status,
'O', 'Open',
'C', 'Closed',
'F', 'Future',
'N', 'Never',
closing_status
) closing_status
from gl.gl_period_statuses
where application_id in (101, 201, 200, 222)
and upper (period_name) in ('JAN-13', 'FEB-13', 'MAR-13')
and set_of_books_id = 1001) f
) g
group by set_of_books_id , period_name, period_num
whoah this blog is wonderful i love reading your articles.
Keep up the good work! You know, lots of people are searching around for this information, you could help them greatly.
Here is my webpage ... women dating
Hi Prashanth,
Can we automate closing of an inventory period for all sites once purchasing period has been closed.
sites with pending transactions will not be closed and an email will be sent as an alert.
My email is dllcharan@gmail.com.Hope to be in touch
Kind Regards
Siva charan
Feel free to visit my web page - animaspace.com
Have a look at my webpage: http://adamscapgroup.com/faqs/groups/hit-holland-females-at-only-dutch-adult-dating-sites/
Hey very nice site!! Man .. Beautiful .. Amazing .
. I will bookmark your website and take the feeds also�I am happy to find numerous useful information here
in the post, we need work out more strategies in this regard, thanks
for sharing. . . . . .
Also visit my webpage - dating online for free
Excellent beat ! I would like to apprentice even as you amend your web site, how can i subscribe for a weblog website?
The account aided me a appropriate deal. I had been a little bit acquainted of this your broadcast offered vivid clear concept
Feel free to visit my site :: online dating service
Great post. I used to be checking continuously this weblog and
I'm inspired! Extremely helpful info particularly the closing section :) I care for such info a lot. I was seeking this certain info for a very lengthy time. Thanks and good luck.
Look at my webpage - facebook sex
people who are at high risk with developing future
asbestos related malignancies. Thanks for discussing your ideas about
this important ailment.
My webpage: facebook sex
Thanks for the strategies you have contributed here. Furthermore, I believe there are several factors
which will keep your car insurance policy premium all the way down.
One is, to contemplate buying motors that are from the good directory of car insurance companies.
Cars that happen to be expensive are at risk of being snatched.
Aside from that insurance is also based on the value of your automobile, so the
more expensive it is, then the higher a premium you have to pay.
my webpage :: http://test.medicalmummies.org/
One more thing. In my opinion that there are lots
of travel insurance web sites of respectable companies
that allow you to enter your holiday details and find you the
rates. You can also purchase your international travel insurance policy online by using your
current credit card. All that you should do would be to enter your travel specifics and
you can view the plans side-by-side. Just find the plan that suits your financial budget and needs
and after that use your credit card to buy the idea. Travel insurance online is a good way to start looking for a respectable company pertaining to international travel
cover. Thanks for revealing you
Look into my web page :: facebook for sex
I enjoy you because of your whole labor on this website. My mum really loves managing
investigation and it's easy to understand why. We all learn all about the dynamic way you give vital information via this web blog and as well as recommend response from some others on the issue then our favorite princess has been learning a whole lot. Enjoy the remaining portion of the new year. You have been doing a w job.
My blog: facebook of sex
hello there and thank you for your information � I�ve certainly
picked up something new from right here. I did however expertise several
technical issues using this site, since I experienced to reload the website many
times previous to I could get it to load properly. I had been wondering if your web
hosting is OK? Not that I am complaining, but sluggish loading instances times will often affect
your placement in google and can damage your high quality score if advertising and marketing with Adwords.
Well I am adding this RSS to my email and can look out
for a lot more of your respective interesting content.
Make sure you update this again very soon..
Also visit my web page :: facebook sex
Hmm it looks like your site ate my first comment (it was extremely long) so I guess I'll just sum it up what I wrote and say, I'm thoroughly enjoying your blog.
I too am an aspiring blog writer but I'm still new to the whole thing. Do you have any tips and hints for rookie blog writers? I'd certainly appreciate it.
my web-site facebook for sex
Great beat ! I wish to apprentice while you amend
your web site, how could i subscribe for a blog website?
The account helped me a acceptable deal. I had been a little bit acquainted of this your
broadcast provided bright clear idea
my homepage ... fuck book
I am not positive where you are getting your info, but great topic.
I needs to spend a while studying much more or working out more.
Thank you for great info I used to be on the lookout for this info for my mission.
Also visit my website ... facebook of sex
great points altogether, you just gained a new reader.
What would you suggest in regards to your post that you made some days ago?
Any positive?
Here is my site - adult finder
Thank you a bunch for sharing this with all folks you really recognize what you're speaking approximately! Bookmarked. Kindly additionally discuss with my site =). We will have a hyperlink trade arrangement between us!
my website; facebook sex
Very nice Blog..Superb...
This is certainly a really good study for me personally, Must admit that you
are among the really bloggers we ever saw.Thanks for sharing
this informative article.
Review my blog cystic acne
Link exchange is nothing else however it is just placing the other person's blog link on your page at proper place and other person will also do similar in favor of you.
Look into my web site ... fivemenrock.com
After I initially left a comment I seem to have
clicked the -Notify me when new comments are added-
checkbox and from now on each time a comment is added I receive four emails with the exact same comment.
Is there an easy method you can remove me from that service?
Many thanks!
my blog post: vigorelle cream
If you are going for most excellent contents like me, simply pay a visit this web site all the time
for the reason that it gives quality contents, thanks
My web blog :: skinception
After going over a handful of the blog posts on your website, I really
like your technique of blogging. I saved as a favorite
it to my bookmark webpage list and will be checking back soon.
Take a look at my web site as well and let me know
how you feel.
Also visit my web page: semenax ingredients list
Wow does work
Visit my webpage - online dating apps for iphone
can you upload one as to victory the lottery with subliminal communications and scrypts on screen.
say thanks a ton. we appreciate so much your very own work.
montreal.
my web site :: taimapedia.org
This design is steller! You certainly know how to keep a reader entertained.
Between your wit and your videos, I was almost moved
to start my own blog (well, almost...HaHa!) Great job.
I really loved what you had to say, and more than that, how you presented it.
Too cool!
Feel free to visit my blog post :: her solutions where to buy
Thankfulness to my father who stated to me concerning this webpage, this blog
is really awesome.
my webpage ... genf20 plus
There's certainly a great deal to find out about this subject. I really like all the points you have made.
Feel free to surf to my page :: http://www.sbwire.com/press-releases/proactol-plus-review-new-studies-and-clinical-results-store-less-fat-and-lose-more-weight-238616.htm
Hello, i read your blog occasionally and i own a similar one and
i was just wondering if you get a lot of spam remarks?
If so how do you reduce it, any plugin or anything you can advise?
I get so much lately it's driving me insane so any help is very much appreciated.
Feel free to surf to my web-site ... stop hair growth cream
Post a Comment