Display 1 month day using connect by

Hi,
How can we display 1 month date say from 1 jan 2010 to 31 han 2010 using connect by function.

Check this link http://www.orafaq.com/wiki/Oracle_Row_Generator_Techniques.
By
Vamsi

Similar Messages

  • Date Difference in Months & Days using XSLT

    Hi,
    I have two dates and want to calculate how many months & days in between those using XSLT, do we have inbuilt functions to do the same?
    E.g. Start Date: 05/25/2014
           End Date: 12/31/2014
    Desired Output: 7 Months & 7 days (end date included in calculation)
    Thanks in advance.

    Hi,
    In XLST 2.0 (XPath 2.0) you can just use operator - to find difference between to dates, there's an example on link below...
    http://stackoverflow.com/questions/5544762/finding-the-difference-between-2-dates-in-xslt
    However, Oracle's implementation is not a full XSLT 2.0 (XPath 2.0), so it may not work... Please test it and let us know...
    <xsl:stylesheet version="2.0"
       xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
       xmlns:xs="http://www.w3.org/2001/XMLSchema"
       xmlns:my="my:my">
       <xsl:output omit-xml-declaration="yes" indent="yes"/>
    <xsl:template match="/">
       <xsl:variable name="vDate1"
       select="my:dateFromUsDate(/*/d1)"/>
       <xsl:variable name="vDate2"
       select="my:dateFromUsDate(/*/d2)"/>
       <xsl:sequence select=
       "($vDate1 - $vDate2) div xs:dayTimeDuration('P1D')"/>
    </xsl:template>
    <xsl:function name="my:dateFromUsDate" as="xs:date">
      <xsl:param name="pUsDate" as="xs:string"/>
      <xsl:sequence select=
      "xs:date(concat(substring($pUsDate,7,4),
      substring($pUsDate,1,2),
      substring($pUsDate,4,2)
      "/>
    </xsl:function>
    </xsl:stylesheet>
    Cheers,
    Vlad

  • Display dates with zeros for month, day, year.

    I have a date coming from a database as an int (20021215 means 12/15/2002). If the database gives me a "0", meaning no date value is assigned, then it should be displayed as "00/00/0000". The following code snippet works for the non-zero int database values ...
    public static String formatDisplayDate(int date) {
        String dateAsString = null;
        if (date == 0) {
            dateAsString = "00000000";
        else {
            dateAsString = Integer.toString(date);
        String strYear = dateAsString.substring(0,4);
        String strMonth = dateAsString.substring(4,6);
        String strDay = dateAsString.substring(6);
        int year = Integer.parseInt(strYear);
        int month = (Integer.parseInt(strMonth)) - 1;
        int day = Integer.parseInt(strDay);
        DateFormat myFormat = DateFormat.getDateInstance(DateFormat.SHORT);
        Calendar cal = myFormat.getCalendar();
        cal.set(year, month, day);
        Date myDate = cal.getTime();
        String formattedDate = myFormat.format(myDate);
        return formattedDate;
    }Although I didn't really expect the zero values case to work, I am not sure how to implement it. How would I go about building a string using all zeros and still have it automatically display in the correct locale format?
    Any help is appreciated.

    Thank you for your response. I agree a blank field would be better, but I think the "zeros" format is there to give the user an idea of expected date entry formatting, not that they'll necessarily follow it. I have made a few changes per your suggestions (shown below for the record, minus the exception handling), and it works perfectly.
    public static String formatExternalDate8(int date) {
      String dateAsString = null;
      if (date == 0) {
        dateAsString = "00010101";
      else {
        dateAsString = Integer.toString(date);
      int year = Integer.parseInt(dateAsString.substring(0,4));
      int month = (Integer.parseInt(dateAsString.substring(4,6))) - 1;
      int day = Integer.parseInt(dateAsString.substring(6));
      DateFormat myFormat = DateFormat.getDateInstance(DateFormat.SHORT);
      Calendar cal = myFormat.getCalendar();
      cal.set(year, month, day);
      Date myDate = cal.getTime();
      String formattedDate = myFormat.format(myDate);
      if (date == 0) {
        formattedDate = formattedDate.replace('1', '0');
      return formattedDate;
    }Thanks again for your assistance.

  • How to calculate the number of days until your next birthday. Only using current month, day and birth month and day.

    I'm trying to calculate the number of days until your next birthday. Only using current month, day and birth month and day. I can get close but i'm way off. When i enter in the next day, the amount of days is supposed to be 364. This is where I am having problems. I know my code is way off. I just need some guidance please!
    Attachments:
    D5.7_1.vi ‏8 KB

    I just had a little fun with the Time Record...
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines
    Attachments:
    D5.7_1_BD.png ‏19 KB

  • Month Display problem in OBI using SQL server

    Hi I am using SQL Server and in one of the reports that I am producing the month is displayed as
    CAL_MONTH
    APRIL
    AUGUST
    DECEMBER
    FEBRUARY
    JANUARY
    JULY
    JUNE
    MARCH
    MAY
    NOVEMBER
    OCTOBER
    SEPTEMBER
    instead of
    CAL_MONTH
    JANUARY
    FEBRUARY
    MARCh
    I used the Evaluate function that I used in Cube (ESSBASE) where it worked OK.
    I created a logical column "Sort Order" and used the following expression:
    EVALUATE('Rank( %1.dimension.currentmember,%2.members)' AS INTEGER , "MIC"."MIC_DL"."dbo"."DM_DATE"."CAL_MONTH", "MIC"."MIC_DL"."dbo"."DM_DATE"."CAL_MONTH")
    Then I set the the Sort Order column with the CAL_MONTH column.
    But this is giving me the following error when retrieving thru presentation layer
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 16001] ODBC error state: 37000 code: 8180 message: [Microsoft][ODBC SQL Server Driver][SQL Server]Statement(s) could not be prepared.. [nQSError: 16001] ODBC error state: 37000 code: 1035 message: [Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near 'Rank', expected 'OVER'.. [nQSError: 16002] Cannot obtain number of columns for the query result. (HY000)
    SQL Issued: SELECT DM_DATE.CAL_MONTH saw_0 FROM MIC_DL ORDER BY saw_0
    I used the expression Rankover in place of Rank but nothing fruitful.
    Pls. guide.
    Edited by: user10729112 on Aug 24, 2009 7:52 AM

    Could anyone guide on this pls....
    I could create a duplicate column containing the vlaues 1,2 .....for the month and use "Case - When " expression but the table has already been built with Jan, Feb ......
    Pls. help.

  • Need to display "Calendar Month/Year" at report level from Calendar Day

    Hello Experts,
    I have a scenario in which I have 0CALDAY (e.g. 01.01.2009) along with other fields available in my report. My requirement is to display "Calendar Month/Year" (01.2009) in my report. Is it possible to have "Calendar Month/Year" in my report from 0CALDAY, by making changes to the query, as I cannot remodel the underlying InfoCube.
    Many Thanks,
    VA

    What you mean with huge - 100 Mio dataset?
    The import of the new infocube will be also take a long time - the database must be insert a new field for every dataset.
    => is this a big infocube, then don't use virtual infoobjects.
    => on a big infocube is important to have a good datamodel - please insert always all 11 infoobjects for the time dimension.
    Sven

  • Month day display in matrix report

    in matrix report date field convert into day and it is as row filed if any day of month data not found but it display all 30 days in matrix report.

    try this query
    select rownum as run_num,to_date('01-' || :A_MONTH || '-' || :A_YEAR,'dd/mm/yyyy')+ (rownum-1) CV from
    (select 1 from dual group by cube (1,1,1,1,1))

  • Good afternoon, I would like some information I have an ipod nano 6th generation and has the same one-year warranty is only 2 months of use, and it fell down and broke the glass of the display, I called technical assistance in Brazil and informed me that

    Good afternoon, I would like some information I have an ipod nano 6th generation and has the same one-year warranty is only 2 months of use, and it fell down and broke the glass of the display, I called technical assistance in Brazil and informed me that Brazil has no repair services for Apple, which was the basis of its price change in the exchange is not worth half the value of the product.
    I wonder how I do to change this device without the expense of 50% for the same product is in warranty?
    Thanks in advance.

    yes agree, plus a multinational seeing a product and has no technical assistance to do the maintenance then it's no use I buy a new product if it is damaged I will always be because it has no prejudice in this maintenance.
    sorry but even more products coming from China to Brazil in technical assistance.

  • HT4293 i am trying to use dual monitors when editing with FCPX. I have a macbook pro and an apple cinema display monitor. I have connected them and opened Fcpx but the option to use second monitor is not active! what do i do ? please help going bonkers!

    i am trying to use dual monitors when editing with FCPX. I have a macbook pro and an apple cinema display monitor. I have connected them and opened Fcpx but the option to use second monitor is not active! what do i do ? please help going bonkers!

    <http://support.apple.com/kb/HT5891>
    You can use USB for the Apple trackpad.
    <http://www.mobeetechnology.com/the-power-bar.html>

  • HT1695 My new iPad with Retina Display is not able to connect to the Wi-Fi of my new Time Capsule. It used to connect, but now it just spins and spins and never connects. I've tried rebooting everything many times.

    My new iPad with Retina Display is not able to connect to the Wi-Fi of my new Time Capsule. It use to connect, but now it just spins and spins and never connects. I've tried rebooting everything many times.

    Some things to try first:
    1. Turn Off your iPad. Then turn Off (disconnect power cord for 30 seconds or longer) the wireless router & then back On. Now boot your iPad. Hopefully it will see the WiFi.
    2. Go to Settings>Wi-Fi and turn Off. Then while at Settings>Wi-Fi, turn back On and chose a Network.
    3. Change the channel on your wireless router (Auto or Channel 6 is best). Instructions at http://macintoshhowto.com/advanced/how-to-get-a-good-range-on-your-wireless-netw ork.html
    4. Go into your router security settings and change from WEP to WPA with AES.
    5.  Renew IP Address: (especially if you are droping internet connection)
        •    Launch Settings app
        •    Tap on Wi-Fi
        •    Tap on the blue arrow of the Wi-Fi network that you connect to from the list
        •    In the window that opens, tap on the Renew Lease button
    ~~~~~~~~~~~~~~~~~~~~~~~~~
    iOS 6 Wifi Problems/Fixes
    How To: Workaround iPad Wi-Fi Issues
    http://www.theipadfan.com/workaround-ipad-wifi-issues/
    Another Fix For iOS 6 WiFi Problems
    http://tabletcrunch.com/2012/10/27/fix-ios-6-wifi-problems-ssid/
    Wifi Doesn't Connect After Waking From Sleep - Sometimes increasing screen brightness prevents the failure to reconnect after waking from sleep. According to Apple, “If brightness is at lowest level, increase it by moving the slider to the right and set auto brightness to off.”
    Fix For iOS 6 WiFi Problems?
    http://tabletcrunch.com/2012/09/27/fix-ios-6-wifi-problems/
    Did iOS 6 Screw Your Wi-Fi? Here’s How to Fix It
    http://gizmodo.com/5944761/does-ios-6-have-a-wi+fi-bug
    How To Fix Wi-Fi Connectivity Issue After Upgrading To iOS 6
    http://www.iphonehacks.com/2012/09/fix-wi-fi-connectivity-issue-after-upgrading- to-ios-6.html
    iOS 6 iPad 3 wi-fi "connection fix" for netgear router
    http://www.youtube.com/watch?v=XsWS4ha-dn0
    Apple's iOS 6 Wi-Fi problems
    http://www.zdnet.com/apples-ios-6-wi-fi-problems-linger-on-7000004799/
    ~~~~~~~~~~~~~~~~~~~~~~~
    How to Fix a Poor Wi-Fi Signal on Your iPad
    http://ipad.about.com/od/iPad_Troubleshooting/a/How-To-Fix-A-Poor-Wi-Fi-Signal-O n-Your-iPad.htm
    iOS Troubleshooting Wi-Fi networks and connections  http://support.apple.com/kb/TS1398
    iPad: Issues connecting to Wi-Fi networks  http://support.apple.com/kb/ts3304
    WiFi Connecting/Troubleshooting http://www.apple.com/support/ipad/wifi/
    How to Fix: My iPad Won't Connect to WiFi
    http://ipad.about.com/od/iPad_Troubleshooting/ss/How-To-Fix-My-Ipad-Wont-Connect -To-Wi-Fi.htm
    iOS: Connecting to the Internet http://support.apple.com/kb/HT1695
    iOS: Recommended settings for Wi-Fi routers and access points  http://support.apple.com/kb/HT4199
    How to Quickly Fix iPad 3 Wi-Fi Reception Problems
    http://osxdaily.com/2012/03/21/fix-new-ipad-3-wi-fi-reception-problems/
    iPad Wi-Fi Problems: Comprehensive List of Fixes
    http://appletoolbox.com/2010/04/ipad-wi-fi-problems-comprehensive-list-of-fixes/
    Connect iPad to Wi-Fi (with troubleshooting info)
    http://thehowto.wikidot.com/wifi-connect-ipad
    Fix iPad Wifi Connection and Signal Issues  http://www.youtube.com/watch?v=uwWtIG5jUxE
    Fix Slow WiFi Issue https://discussions.apple.com/thread/2398063?start=60&tstart=0
    How To Fix iPhone, iPad, iPod Touch Wi-Fi Connectivity Issue http://tinyurl.com/7nvxbmz
    Unable to Connect After iOS Update - saw this solution on another post.
    https://discussions.apple.com/thread/4010130
    Note - When troubleshooting wifi connection problems, don't hold your iPad by hand. There have been a few reports that holding the iPad by hand, seems to attenuate the wifi signal.
    ~~~~~~~~~~~~~~~
    If any of the above solutions work, please post back what solved your problem. It will help others with the same problem.
     Cheers, Tom

  • Default iCal Display to Current Day/Month?

    Whenever I open iCal on Yosemite 10.10.1, it by default displays the last month/day I was viewing when previously exiting the app. Is there any way to have iCal display the current day/month by default at launch?

    In case anyone else is looking for a solution to this, I'm come up with a temporary hack. It is a shell script that clears out the most recent calendar view, which results in the Calendar app opening to the current day/month. I've setup a crontab job to run the script every 10 minutes. It's not a perfect fix, but it does the job just fine.
    The script/terminal command:
    /usr/bin/defaults delete com.apple.iCal "CalFirstVisibleDate"
    To install a crontab job which runs the script periodically (every ten minutes in this case), insert the following line into your crontab config (run crontab -e from terminal):
    */10 * * * * /usr/bin/iCalDateReset.sh
    This assumes that you have installed the script as /usr/bin/iCalDateReset.sh

  • I have a mid 2009 13'' MBP. I got the battery replaced in Apple store, It then stopped displaying the battery status LED. After some months of use my MBP died. I got it checked in Apple verfied Service centre and was told that logic board was to blame

    I have a mid 2009 13'' MBP. I got the battery replaced in Apple store, It then stopped displaying the battery status LED.
    After some months of use my MBP died outside USA. I got it checked in Apple verfied Service centre and was told that logic board was faulty.
    After I came back to US I took my MBP to Apple store and was told that there is liquid damage in the system. My question is that if there was liquid damage why did my MBP stop displaying the battery status right after  the battery was changed secondly why didnt the apple verified Service centre tell me that there was liquid damage afterall I paid them the money for diagnosing the problem.
    Is there a process i can followup on this problem

    These are question you would need to ask that service center.
    This is a User to User forum. No Apple employees here.

  • Multiple (not full) day events displaying in monthly view

    If I have an event that starts on 8:00 AM on Tuesday, and ends on 5:00 PM on Wednesday, It won't display in monthly view on Wednesday in iCal. It looks as though I have nothing scheduled on Wednesday.
    Is this "feature" something that Apple is working to eliminate?

    Ramone4130,
    The first and easiest troubleshooting step involves replacing/refreshing the com.apple.iCal.plist file.
    Quit iCal and find the com.apple.iCal.plist file in your Macintosh HD/Users/yourusername/Library/Preferences Folder. Drag the file to your Desktop, log out/in or restart and check iCal for normal behavior.
    ;~)

  • To Display "Calendar Month/Year" at report level from Calendar Day

    Hello Friends,
    I have a scenario in which I have 0CALDAY (e.g. 01.01.2009) along with other fields available in my report. My requirement is to display "Calendar Month/Year" (e.g. 01.2009) in my report.
    Is it possible to have "Calendar Month/Year" in my report from 0CALDAY, by making changes to the query, as I cannot remodel the underlying InfoCube?
    Many Thanks,
    VishwA

    HI Vishwa,
    Hope it will helps.
    How to get month from CREATE DATE field??
    Regards,
    SVS

  • Month generations using sql query

    Hi,
        Based on the input date parameter,I need to display all months in current year and last year.
    For example, suppose my in date parameter is '12-05-14', I need the below output.
    JANUARY 
    FEBRUARY
    MARCH   
    APRIL   
    MAY     
    JUNE    
    JULY    
    AUGUST  
    SEPTEMBER
    OCTOBER 
    NOVEMBER
    DECEMBER
    JANUARY 
    FEBRUARY
    MARCH   
    APRIL   
    MAY     
    Until may month and last year whole month.I have come up with query. Please find the below query.
    select to_char(add_months(trunc(sysdate,'year'),level-1),'MONTH') mth
    from dual
    connect by level <= 12
    union all
    select to_char(to_date(ddate,'MM'),'MONTH') Month
    from (select 1 + rownum - 1 ddate
    from user_objects
    where (1 + rownum - 1) <= to_number(to_char(to_date('12-05-14','dd-mm-yy'),'mm')));
    But I don't want to use user_objects data dictionary. Can you please guide how to achieve this output or Can u give me some other query also if possible.
    Thanks
    Siva

    /* Formatted on 2014/01/24 03:55 (Formatter Plus v4.8.8) */
    SELECT
    TO_CHAR (ADD_MONTHS (TRUNC (SYSDATE, 'YYYY'), LEVEL - 1), 'MONTH'
    FROM
    DUAL
    CONNECT
    BY LEVEL <= 12 + TO_NUMBER (TO_CHAR (SYSDATE, 'MM'

Maybe you are looking for