Last day and least

pkg.function
  select  find_pkg.open_period from dual ------------------
output
Dec-2012
How to find the last day of the month. how to modify the above query.
after the calculation find the least of date
please help me to modify below query. both the queries are combined.
select least(last_day(find_pkg.open_period),sysdate) from dual

If the output is a string 'Dec-2012' you can do like this:
SELECT LEAST (LAST_DAY (TO_DATE ('Dec-2012', 'Mon-YYYY')), SYSDATE) FROM DUAL;
{code}
of course you have to replace 'Dec-2012' with your function in this way:
{code:sql}
SELECT LEAST (LAST_DAY (TO_DATE (find_pkg.open_period, 'Mon-YYYY')), SYSDATE) FROM DUAL;
{code}
Regards.
Al                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Similar Messages

  • I changed my LCD last day and now i noticed all my pictures on my phone are gone. I tried to restore the back that I got yesterday but it wont let me because its telling me there is not enough space on my phone!!!

    I changed my LCD last day and now i noticed all my pictures on my phone are gone. I tried to restore the back that I got yesterday but it wont let me because its telling me there is not enough space on my phone!!! That's wierd because I didn't download any app or anything else since my last backup and on the other hand about 3000 pictures are gone, how come there is not enough space left! I also check my usage on my phone and it shows that i have about 7.0 GB pictures!!! BUT my photos is empty! I want my picture back on my phone any solution anyone?

    Thanks for your reply!
    I just called the guy who changed my LCD and asked him what happend, he said there were no pictures on your phone when you gave it to me! i know he is lying tho!
    My apple warranty is over and I have to pay them to get some help over the phone!

  • I dropped my iphone 3G last day and soon after the display became very dim and it still remanins the same..Could anyone pls help with a solution? Should I change the display or is it a minor damage?

    I dropped my iPhone 3G last day and soon after that the display turned too dim and it still remains the same.
    Could anyone help me with a solution?
    Should I change the display or is it a minor damage??
    Thanks for your support

    sounds like you broke the display when you dropped it.  There's nothing we users here can do for you.
    Since the iPhone warranty does not cover accidental damage, you will have to pay to have your phone repaired or replaced.  You can bring it into Apple for an out of warranty exchange in the country of purchase, or you can find a 3rd party iPhone repair store in your area.

  • Hey, i was using the trial version. today is my last day and i want to buy the reald paid version. will i lose the work i was doing till today if i buy the paid version?

    hey, i was using the trial version. today is my last day and i want to buy the reald paid version. will i lose the work i was doing till today if i buy the paid version?

    Your mileage may differ, but when you reach the end of the trial period, you will get a dialog telling you so and directing you to log into CC and activate that version.  You don't need to reload the program usually. 
    That said, if you were being careful, you would copy the program files to another directory.  Since the program manager assets are just pointesr to the files in the directories were they reside, you shouldn't need to copy the video/image files--just the program files

  • Apple Podcast app won't display past episodes of The Rachel Maddow Show. Does anybody know why you can only listen to the episode from the last day, and then it disappears?

    I love the Rachel Maddow Show but rarely get to watch it on TV. So I rely on the podcasts to listen to every day. I've been using Stitcher but Apple's more recent Podcast app has much better functionality (downloading episodes to listen to on the subway & plane, for instance). However, for some reason (and it appears to only be TRMS podcasts), the Apple Podcast app ONLY displays the last episode. For some reason, each day, the last episode disappears from the app.

    Same here! Older episodes don't necessarily disappear as soon as new ones come in; sometimes I have a few episodes on the iPhone, and can listen to them normally. But then I'll look later, and all but the latest will have disappeared. I'll have to start paying attention to discover what triggers the wipe; my guess is that syncing with iTunes does it, but I don't know yet.
    Whatever the cause, it's odd. I thought that perhaps queued episodes would stick around if I partially listened to them (thus ensuring that they get actually downloaded, I'd think), but partially-viewed episodes and unviewed episodes both disappear. I can understand that an episode that never got downloaded might become unavailable after a day or few, but why would one already downloaded get automatically erased?
    It's also worth noting that I don't have the problem in iTunes on the Mac. Episodes there stick around in the normal fashion. The problem is just on my iPhone, and just with this one podcast.
    If anyone knows what's up, please tell!

  • If Current Month then use last day, else use month

    My cube is setup where the current month is at a daily level and the previous months just contain the last day of data.
    I would like to for the last month to only return the last day and return the month level for all previous months. The reason being is our third party software gives us the capability of doing a drillthrough, but when doing it for the latest month, it is
    returning every day in that month.
    Here is my attempt, but it is only returning the last month, not the rest of the months.
    select [Measures].[Current Balance]
    on 0, non empty
    [Date].[Month].children
    on 1
    from [MyCube]
    where
    IIF([Date].[Month].CurrentMember = ClosingPeriod([Date].[Month].[Month]),
    TAIL (NonEmpty([Date].[Date].members,[Measures].[Count Of Accounts]),1),
    [Date].[Month].CurrentMember)

    Hi Dodge,
    I’m writing to follow up with you on this post. Was the problem resolved by the above query?
    If the issue was solved, I’d like to mark this issue as "Answered". Please also feel free to unmark the issue, with any new findings or concerns you may have.
    Thanks,
    Charlie Liao
    TechNet Community Support

  • After uploading our phones with the latest update, we have noticed that the battery life has deminished considerably.  I now have to charge my phone overnight and two or three times a day. Prior to the update, my battery life lasted me at least a full day

    After uploading our phones with the latest update, we have noticed that the battery life has deminished considerably.  I now have to charge my phone overnight and two or three times a day. Prior to the update, my battery life lasted me at least a full day.  We have several phones in our office and the ones that have updated (4) now have issue holding a charge/battery life. I really liked this phone and can not believe that you are now going to charge us $79 a battery to fix what is most definately a problem with your latest update.  I know other people outside of our company that are having the same problem. Not to mention when I called AT&T it was confirmed to me that they are hearing the same issue and then some from other customers as well.  Your own people, once I talked to them earlier today, told me they are showing a history of issues that are showing up after the update was put in place. Of course she tried to say, "Maybe the age of the battery and the update both contributed".  Whatever. 
    I want you all to know how disappointed I am in your company for the handling of this issue.  I always thought "Apple" was the line I didn't have to worry about having any types of issue. And that you all would stand behined your product 100%. Now I am not so sure.   
    I would love to hear back from your company on how you perceive the issue with all of these phones that prior to the update didn't have any issues and how after the update THEY ARE NOW having issues.  I do not believe this was an issue due to the age of a battery and that was pretty lame to say so.  It was fine and now its not.
    Please feel free to contact me and help me figure out a way to pay for all of the batteries that will be needed for our company to contiue doing business as needed.
    Thank you.
    Web Address (URL):
    5106 McNarney

    Sorry this is a user to user technical forum.  There is NO APPLE here as stated in the term of use when you signed up for this forum.
    here are some battery tips
    http://osxdaily.com/2013/09/19/ios-7-battery-life-fix/
    http://www.apple.com/batteries/iphone.html

  • My wifi goes down at least once a day and I have to unplug the time capsule and reboot it and then it works fine.  Any idea why this is happening/what I can do to fix it?

    My wifi goes down at least once a day and I have to unplug the time capsule and reboot it and then it works fine.  Any idea why this is happening/what I can do to fix it?

    I was having this problem while still using Mavericks -- it started after a Mavericks update last spring.  During the initial Yosemite beta runs over the summer, it seemed to be fixed, but after the official launch in October, I had all sorts of problems keeping connected.  Its gotten a little better, but still happens to at least one of my devices every day.  Weird that we still cannot figure out why the connection keeps dropping on some devices, but not others, and then the next day, one of the devices that didn't disconnect the previous day will disconnect, but the ones that did disconnect, stay connected.  It's just sloppy, poorly written software for technology that isn't working the way it should.  If you turn off Continuity and Handoff on all your devices, you will probably see that everything stays connected.  With those turned off on all devices, TC stayed connected to everything for over a month.  The day I turned Continuity back on, all the problems started again.  It had something to do with the bluetooth version being used, the wifi routine, and Apple's AirPlay technology not quite getting along with each other.

  • Ios 5 Update New Features says that iCal now has a week view for iPhone but after updating last weekend, I don't see any week view--just List, Day and Month..How do I get the week view?

    ios 5 Update New Features says that calendar now has a week view but after updating my iPhone 4 last weekend, I don't see any week view for iCal--just List, Day and Month as in the past. Is the weekly view available for iCal and if so, how do I access it?

    Rotate your phone to landscape.

  • I recently bought a new i phone 4 as my other one had seen beter days and for the last sevral days have been trying to transfer my photos ect from my old phone to my new one after I've plugged my old iPhone into iTunes to back it up i then plug in my    i

    I recently bought a new i phone 4 as my other one had seen beter days and for the last sevral days have been trying to transfer my photos ect from my old phone to my new one after I've plugged my old iPhone into iTunes to back it up i then plug in my one to transfer it over I've had no luck I've tryed restoring my new phone to the last time i backed up my old files the phone restores but always to its own backup point wen i first connected it to iTunes can anyone help me please?

    Since this is the second computer you've had this problem with, I recommend you look for answers on the iPhone forum. My thinking is it is an iPhone issue rather than a computer issue (unless it is some software incompatibility).

  • I have iphone 3gs and last days i made upgrade 5.01, but i dont know that this version is not avaliable in brasil yet. than my iphone 3gs 32 gb no more find the wide and it be seaching the sinal. what i need to do to back to before situation. thanks a lo

    i have iphone 3gs and last days i made upgrade 5.01, but i dont know that this version is not avaliable in brasil yet. than my iphone 3gs 32 gb no more find the wide and it be seaching the sinal. what i need to do to back to before situation. thanks a lot

    iOS 5.0.1 has been out for a couple months, if not longer. 
    There was no delay in releasing it in any country.
    So what is your issue? 

  • Need the first day of the year and last day of the year.

    hi all,
    i need a function module which can get me the first day of current year and last day of the current year??
    please help.

    Similar date questions are being asked ALL THE TIME.  Please search.

  • How to find first and last day of last month?.

    Hello,
    I am using Crystal Report XI.
    Reports will be generated on first of every month for
    previous month. I want to find start and end date of previous month
    dynamic.
    For august, Start date is July 1st and End date July 31st.
    For September, start date is Aug 1st and Aug 31st.
    How can i get first of previous month as start date and last
    day of the previous month as end date?.
    Same kind of thing I want to do for future report ..find next
    month start date and end date.
    Thanks

    Adomacro,
    you could do a function, like this
    <cffunction name="getReportdates" returntype="struct"
    hint="Given an arbitrary month and year, the function returns a
    structure containing the first and last day of the previous
    month">
    <!--- Take current month and current year as the default
    --->
    <cfargument name="mnth" type="string" required="No"
    default="#monthAsString(month(now()))#">
    <cfargument name="yr" type="numeric" required="No"
    default="#year(now())#">
    <cfset firstDayOfGivenMonth = parseDateTime("1 " &
    arguments.mnth & " #arguments.yr#")>
    <cfset lastDayOfPreviousMonth =
    dateAdd("d",-1,firstDayOfGivenMonth)>
    <cfset numberOfDaysOfPreviousMonth =
    daysInMonth(lastDayOfPreviousMonth)>
    <cfset firstDayOfPreviousMonth =
    dateAdd("d",-#numberOfDaysOfPreviousMonth#,firstDayOfGivenMonth)>
    <cfset reportDates = structNew()>
    <cfset reportDates.firstDayOfPreviousMonth =
    firstDayOfPreviousMonth>
    <cfset reportDates.lastDayOfPreviousMonth =
    lastDayOfPreviousMonth>
    <cfreturn reportDates>
    </cffunction>
    <!--- Example usage --->
    <p>
    Given month: <strong>March
    2004</strong><br>
    begin date:
    <cfoutput>#dateFormat(getReportdates('March',2004).firstDayOfPreviousMonth,"d
    mmm yyyy")#</cfoutput><br>
    end date:
    <cfoutput>#dateFormat(getReportdates('March',2004).lastDayOfPreviousMonth,"d
    mmm yyyy")#</cfoutput><br>
    </p>
    <p>
    Given month: <strong>August
    2007</strong><br>
    begin date:
    <cfoutput>#dateFormat(getReportdates('August',2007).firstDayOfPreviousMonth,"d
    mmm yyyy")#</cfoutput><br>
    end date:
    <cfoutput>#dateFormat(getReportdates('August',2007).lastDayOfPreviousMonth,"d
    mmm yyyy")#</cfoutput><br>
    </p>

  • Get First and last day of Month..

    Hi Friends,
    I am trying to fetch First and Last day of a month and would like to implement that in the following code:
    SELECT COALESCE(Date_A, Date_B, Date_C)
    FROM dual
    Here Date A and B are in Format of MM DD YYYY (March 14, 2008)
    and Date C is like MM YYYY (March 2008)
    How can I get the Date_C as March 1, 2008 OR March 31, 2008 format if Date A and B are NULL ?
    Thanks!
    Edited by: user11095386 on Apr 23, 2009 10:45 AM

    Hi,
    In my earlier message, I thought that you were starting with strings like '03 12 2009' and that you wanted to display them as 'March 12 2009'. If what you have is just the reverse, then just reverse the format strings in my first message. Add a comma, if you want one, in the appropriate format string.
    I believe this is what you want:
    COALESCE ( TO_CHAR ( TO_DATE ( Date_A, 'fmMonth DD YYYY'), 'MM DD YYYY')
             , TO_CHAR ( TO_DATE ( Date_B, 'fmMonth DD YYYY'), 'MM DD YYYY')
             , TO_CHAR ( TO_DATE ( Date_C, 'fmMonth YYYY'),    'MM DD YYYY')
             )Notice how, on the 3rd line, TO_DATE is called without DD in the format string:
    TO_DATE ( Date_C, 'fmMonth YYYY')When you do this, the day defaults to the 1st of the month, so this is all you have to do to convert the VARCHAR2 'March 2009' to the DATE 01-Mar-2009.
    If you want the last day of the month, not the first, when Date_C is chosen, then use LAST_DAY:
    COALESCE ( TO_CHAR ( TO_DATE ( Date_A, 'fmMonth DD YYYY'), 'MM DD YYYY')
             , TO_CHAR ( TO_DATE ( Date_B, 'fmMonth DD YYYY'), 'MM DD YYYY')
             , TO_CHAR ( LAST_DAY ( TO_DATE ( Date_C
                                              , 'fmMonth YYYY'
                 , 'MM DD YYYY'
             )

  • How to find first and last day of previous month?.

    Based on current month, I want to find start and end day of
    previous month.
    For example,
    For august, Start date is July 1st and End date July 31st.
    How can i get first of previous month as start date and last
    day of the previous month as end date?.
    Same way,
    i want to find start date of current month and end date of
    next month.
    Example:
    For august,
    i want to get start date, august 1st and end date : september
    30.
    How can i do this from current date or now().
    I am looking for best and easy way to find start and end
    dates..
    Thanks

    <cfset today = now()>
    <cfset firstOfThisMonth = createDate(year(today),
    month(today), 1)>
    <cfset lastOfNextMonth = dateAdd("d", -1, dateAdd("m", 2,
    firstOfThisMonth))>
    <cfoutput>
    today = #today#<br>
    firstOfThisMonth = #firstOfThisMonth#<br>
    lastOfNextMonth = #lastOfNextMonth#<br>
    </cfoutput>
    Edit - To find the start and end day of previous month, get
    the first of THIS month. Use Subtract 1 month ("m") to get the
    start date. Subtract 1 day ("d") to get the end date.

Maybe you are looking for

  • Photo library is not backing up when icloud backs up

    MY iPad Air 8.1.1 and my iPhone 5s 8.1.1 both give me a message saying, " icloud photo library has not backed up in 16 days. Connect to wifi and backup."  iCloud backs up daily. Why are my photos not included in this backup. I have iCloud Drive turne

  • Looking for Best Program to Create Online Training Lessons

    I'm looking to purchase some software to create online training lessons. The lessons would consist of screen shots, dialog boxes, narration, possibly animation. Given that Captivate has Flash, I'm hopeful that it would do the trick and be somewhat us

  • Formatting issue(dollar value) within an ITEM

    So I'm trying to display a monetary value in an item. SELECT to_char(SUM(TXN_AMT),'$9,999') from CMS_COST_TRACKING where UPPER(TXN_NODE)='VMAX'this results in ######### in the item If I remove the to_char formatting then the SUM displays correctly. I

  • Virtual Exchange & NAT'ing

    A virtual server currently has Exchange installed on it with load balancing on our network. Each NIC has its own IP address and they want one external address for it to NAT to.  Looking at our ASA, we can't overlap addresses...meaning I get an error

  • Adobe GoLive 6.0

    Hi, I am currently working my way through the book "web programming in ABAP with the SAP web application server". It says that before proceeding to start creating BSP apps., it is recommended to install Adobe GoLive 6.0. The problem is that I cannot