problem of formatting of the year

Hey people,

I'm trying to create a simple list of values to display the dates of 6 years in the current year. Nothing fancy, just two fields, which are supposed to return data as well:

02 - 2002
03 - 2003
04 - 2004
05 - 2005
06 - 2006
07 - 2007
08 - 2008

The SQL I use is this:

SELECT
To_char(sysdate,'YY') + ROWNUM-return, 7
View from to_char(sysdate,'YYYY') + ROWNUM-7
(
SELECT 1
OF the double
connect by level < = 7
);

There might be an easier way to do it, but it's as simple as I could do.

Now my problem is, the data is not returned properly, instead it gives me:

2 - 2002
3 - 2003
4 - 2004
5 - 2005
6 - 2006
7 - 2007
8 - 2008

and I really need those zeros not significant (I build drop-down lists for a payment form). I tried various permutations of TO_CHAR, TO_NUMBER, TO_DATE, but so far I have not been able to find how to get the year should see '08' and not just '8 '.

So if anyone has an idea of what I'm doing wrong, I would be very grateful for any help that you could give. I apologize if this is too simple for words...

See you soon

Hi check this query

SELECT
lpad(TO_CHAR(sysdate,'YY')+ROWNUM -7,2,'0') return,
TO_CHAR(sysdate,'YYYY')+ROWNUM -7 display
FROM DUAL
connect by level <=7

Tags: Database

Similar Questions

  • Problems of formatting of the new CD - RW and open/read/write in older CD - RW

    I have a laptop Compaq Presario C719TU, who has 3 years using Vista Home Basic with a Super Multi 8 x DVD + R/RW with Support Double layer Drive CD/optical .

    2 days ago, I bought a pack of 5 CD - RW (x 12 or 8 to 12 x speed) to back up data on.

    So, I put a CD - RW in CD/optical drive
    and I tried to format, using the (not mastered) Live file system on Vista.
    Try first, the UDF 2.01 (default) then later, the UDF 2.50 version to fit with.

    At the end of the formatting process, a dialog box appears on the screen indicating that:
    "Format disk - Windows was unable to complete the format."
    Why is this?

    When a CD RW is loaded in the CD/optical drive, it will appear in the desktop computer > computer (with the C and D drives and USB keys)

    But I'm unable to format new discs, (Verbatim 12 x speed) or run/open/view all the contents of old discs (TDK 4-12 x speed) I.

    - Or when a CD RW is loaded in the CD/optical drive, it will be a thready or whirring sound as it normally should.

    However, I loaded a DVD in the CD/optical drive and it took a little while to open, he managed to open the application on this matter.

    I tried to uninstall the DVD/CD ROM driver in Device Manager

    (Optiarc DVD RW AD - 7560 A ATA Device)

    then restarted the laptop, but it made no difference.

    I also 'deleted' (near possible uninstall) this lower filter for: {4D36E965-E325-11CE-BFC1-08002BE10318} HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\ with of the registry - as suggested on a web page, but I haven't restarted laptop again to see if it has corrected or not.

    I have use/rely on CD RW to back up important files.

    Hi ordinateur.utilisateur,

    I suggest you try the fix it from the link given below and check if it helps.

    Your CD or DVD drive cannot read or write media

    http://support.Microsoft.com/GP/cd_dvd_drive_problems

    Hope this information is useful.

    Jeremy K
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

    If this post can help solve your problem, please click the 'Mark as answer' or 'Useful' at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • Pro 9 problem when 'Formatting' shows the Adobe document

    I started having this problem last week.  The Word document has the formatting as is is not necessary or not.  Insertions and deletions are provided only to be shown.  When I convert Word to Adobe "formatting" appears throughout my document from Adobe.  How can I get rid of the formatting on my Adobe Doc?  I've never had this problem before and it may be caused by a recent update of Microsoft Word or Adobe was last updated.

    You get the same result if you print to the Adobe PDF printer?

  • error format of the year in the instructions at FLASHBACK_TRANSACTION_QUERY. UNDO_SQL

    I run Remove 20 on table tab1 and validate them.

    flashback is enabled: in the field of table FLASHBACK_TRANSACTION_QUERY UNDO_SQL I can find all the instructions to cancel: in this case, I found exactly 20 insert 20 rows that I deleted.

    the problem is in the date format: insert all have such a timestamp field:

    INSERT IN THE SCHEMA. Tab1 (< fields >) VALUES (TO_TIMESTAMP (February 1, 90 00:00:00 '), < other values >)



    This IS NOT GOOD, insert: I want 4-digit year, so I try to change sessions:

    ALTER SESSION SET nls_timestamp_format = 'DD-MON-YYYY HH24:MI:SS ";


    then I re - run 20 e delete replay flashback table... now insert all have such a timestamp field:

    INSERT IN THE SCHEMA. Tab1 (< fields >) VALUES (TO_TIMESTAMP (February 1, 90 00:00:00 '), < other values >)


    This insert IS ALSO NOT GOOD... good year 1990 is NO 0090! so I try another format:

    ALTER SESSION SET nls_timestamp_format = 'DD-MON-RRRR HH24:MI:SS ";

    and then I also try:

    ALTER SESSION SET nls_timestamp_format = 'DD-MON-RR HH24:MI:SS. "


    nothing... I always have year 0090 in the Insert (instead of 1990)


    P.S. In practice I want something like this: http://www.oracle-developer.net/display.php?id=320

    half page, where it says XID 040028008 A 010000 there is the format I need

    I made just a test:

    SQL> select undo_sql from FLASHBACK_TRANSACTION_QUERY  where table_owner = 'A'
      2  /
    
    UNDO_SQL
    -------------------------------------------------------------------------------------------------------------------------
    insert into "A"."T12"("C1") values (TO_TIMESTAMP('21-JUN-90 06.57.35.000000 PM'));
    insert into "A"."T12"("C1") values (TO_TIMESTAMP('16-JUN-09 06.54.35.656000 PM'));
    
    13 rows selected.
    
    SQL> alter session set nls_timestamp_format = 'DD-MON-RRRR HH.MI.SSXFF AM'
      2  /
    
    Session altered.
    
    SQL> select undo_sql from FLASHBACK_TRANSACTION_QUERY  where table_owner = 'A'
      2  /
    
    UNDO_SQL
    -------------------------------------------------------------------------------------------------------------------------
    insert into "A"."T12"("C1") values (TO_TIMESTAMP('21-JUN-1990 06.57.35.000000 PM'));
    insert into "A"."T12"("C1") values (TO_TIMESTAMP('16-JUN-2009 06.54.35.656000 PM'));
    

    You are quite sure that your original data were in 1990?

    With greetings
    Krystian Zieja

  • Problems of formatting of the new hard drive in Macbook Pro

    Hello

    My internal hard drive in my MacBook Pro mid 2012 broke down. So I installed a new hard drive a ST1000LM014 of Seagate 1 TB hybrid discs which according to IFIXIT.com must be compatible.

    I then boot the server Apple Macbook and party in disk Utillity to format the hard drive. The hard drive is visible and I'm then in the partition, choose the 1 partition, Mac OS X (journaled) + GUID. But while the partition that I get the error message failed to file system format.

    I tried different options in disk Utillity and I am able to format the disk using FAT or ExFat. But it does not help me to use my mac hard drive.

    Does anyone have any ideas on what to do? And it does not seem like a problem with the functionality of the hard drive?

    Thank you

    You must select the disk of material-name (upper, outermost level descriptor), not Volume name.

  • 4.2.5 causing problem of formatting of the apex_mail update fixes group

    I'm under Oracle DB 11.2.0.3 Windowsx64 and Apex 4.2.4.  I recently applied patches 4.2 - > 4.2.5 update Group and I see some weird behavior in the e-mails that sends the Apex.  When you view the email in HTML (with Outlook), I see paragraph breaks and the type of content in the section p_body information such as:

    To the bottom of the category:

    Comment: < p >

    This is a comment < /p >

    -=: A4D7E7711C6A4607A5351F61BF5DF987:

    Content-Type: text/html; charset = utf-8

    Low category: < strong > comment: facilities > < p >

    This is a comment < /p >

    -=: A4D7E7711C6A4607A5351F61BF5DF987: -.

    PL/SQL code to generate the email looks like the following and has been working perfectly under all previous versions of the Apex where I specify p_body and p_body_html and if the drive is capable of HTML, it only displays the HTML part:

    email_ID: = apex_mail.send (p_to = > address_list,)

    P_FROM = > from_address,

    p_body = > v_log,

    p_body_html = > v_log_html,

    p_subj = > subject);

    Any ideas on what would cause this?

    Thank you

    -Ian

    It is the Group of hotfixes 4.2.5 that causes this problem.

    Oracle has a patch to solve this problem.

    Oracle Application Express 4.2.5 known issues

    • 18658967 - CORRUPT ELECTRONIC HTML MESSAGES ARE CREATED from APEX_MAIL. Send
      After the upgrade to demand Express 4.2.5 or by applying the Application Express 4.2.5 patch set on some e-mail servers, all messages sent with the APEX_MAIL. SEND API and which contain a body of the HTML email will appear to the recipient as of damaged files. Often, the recipient will see the body of the message contains headers and message as limits:
        ----=:0CF735AA12E385B1DA023B0BB6124789:
        Content-Type: text/html; charset=utf-8

      Solution: there is an exception to the Group of hotfixes for this on My Oracle Support - search by bug number.
  • Problem of formatting in the content with the horizontal menu widget area

    I use a regular horizontal menu widget with several different taps within an empty page.  I lived as if the content field under the first tap, for example, is 300 pixels long, all other fields of content under other taps will inherit the same height.  Because I have different amounts of text in various taps, I need to be able to REDUCE the height of the text field. But it won't let me.

    Any input is much appreciated!

    Fred

    Hi ACW100,

    Please select size spacing: uniform point in the menu dropdown.

    It does not resize the tabs separately, but it might serve your purpose (spacing problems).

    Kind regards

    Akshay

  • Small product problems page format of the table with the unused sections

    Hi all

    I hope someone can help me identify what it is that I have trouble with my small product catalog pages. I have this problem where I have unused sections or blanks where normally the images/Details of the product would be. I think it can come from my product titles that use more than two lines of characters with these products that I have for sale where the price is bordered by the intermediary with a new price below (extra row of text) where the product is more space than the standard height. It seems to be pushing other products more far more/down to another column/row. I don't know it's somelthing I'm wrong with how the table is set up for the management of the height of each box of product dynamically, but I'm new to this so not sure what you need to fix in the code.

    Here is a link to a page problem showing the problem:

    http://tigressartscomics.com/CGC-graded-comics

    Any help would be greatly appreciated.

    Thank you

    Kennedy

    Hi Kennedy,

    Believe that it is caused by your products from the list in varying heights.

    Have you tried to add a "height: 400px; ' your '.produits-grid li .productSmall?

    Concerning

    Mike

  • Change the year format in a string

    Hello

    I need a little help but its very urgent.

    Can all give a logic how to change a format of the year in a string using sql, plsql.

    ex: "GREAT_2009_AMERICA_2009_SAL".

    ' GREAT_09_AMERICA_09_SAL

    Appreciated your help.

    Thanks in advance.

    Thank you
    ramanamadhav.

    Hello

    So urgent, that you don't have the time to post your version or whatever it is?

    Well, your problem is that you don't have such a thing as a format of the year, you have only a string.

    Perhaps this might do it for you:

    SQL> select 'GREAT_2009_AMERICA_2009_SAL'  old_string
          ,regexp_replace('GREAT_2009_AMERICA_2009_SAL', '([0-9]{1})([0-9]{1})([0-9]{1})([0-9]{1})', '\3\4') new_string
      from dual
    
    OLD_STRING                  NEW_STRING
    --------------------------- -----------------------
    GREAT_2009_AMERICA_2009_SAL GREAT_09_AMERICA_09_SAL
    1 row selected.
    

    Or even

    SQL> select 'GREAT_2009_AMERICA_2009_SAL'  old_string
          ,regexp_replace('GREAT_2009_AMERICA_2009_SAL', '([0-9]{2})([0-9]{2})', '\2') new_string
      from dual
    
    OLD_STRING                  NEW_STRING
    --------------------------- -----------------------
    GREAT_2009_AMERICA_2009_SAL GREAT_09_AMERICA_09_SAL
    1 row selected.
    

    Concerning
    Peter

  • Formatting of the first occurrence of the element with the EDD

    Hello.

    I have a problem of formatting of the first item in paricular type.

    I want the item in bold to always use the same format.

    Is this possible with only ESD?

    Structures of the sample:

    < ITEM >

    Step < 1 >

    < TABLE / >

    < TABLE / >

    < PARA / >

    < Step 2 / >

    < / Step 1 >

    < / ITEM >

    or

    < ITEM >

    Step < 1 >

    < PARA / >

    < PARA / >

    < Step 2 / >

    < / Step 1 >

    < / ITEM >

    or

    < ITEM >

    Step < 1 >

    < OTHER_ELEMENT / >

    < PARA / >

    < TABLE / >

    < PARA / >

    < Step 2 / >

    < / Step 1 >

    < / ITEM >

    Help, please.

    I use FrameMaker 9

    Adamus,

    I think that you have exceeded the capabilities of ESD to this request. {First} mechanism would address scenario 2, but not the other because I think it means "first child" only, not "first child with that particular tag." If EDDs supported of XPath for context rules, it could be done, but it is not available.

    Russ

  • Conversion of the year in YYYY format to return to the selection list

    With Apex 4.1.1 on Linux (Apex Listener on glassfish)

    I have a table with the dates of weekend and use this table for like my LOV.

    The selection list appears as 12-SEPT-12 when I check the value attribute of Firebug. Problem is that it comes as year 0012 instead of 2012 when I try to use it in my PL SQL code to save it in a table.

    Is there a way I can get the return value for the year in YYYY format for the return value to the selection list? Have you tried to_date (dt, ' MON-DD-YYYY "") with no luck.

    See you soon.

    All APEX session state values take place as VARCHAR2s. Explicit conversion between DATE using the specified formats values is recommended. Converted to a VARCHAR2 in the LOV query:

    select to_char(week_ending, 'DD-MON-YYYY') l, to_char(week_ending, 'YYYY-MM-DD') v from ...
    

    and to this DAY in the PL/SQL code of process:

    ...to_date(:p1_week_ending, 'YYYY-MM-DD')...
    

    I'm trying to standardize on the use of ISO 8601 representation of date not displayed values. These are unambiguous, sort correctly by using the semantics of character and are compatible with other systems and technologies.

  • Problem with the format of the values in the command prompt (when you use multiple values)

    Hi all

    I have problem with the format of the values in the command prompt when you use multiple values.

    Value is year (2009) and when I use it in the drop-down list that is formatted, all right, as 2009, but when I use several values I get number as 2009,00. I put in year column format number with 0 decimal places and save by default in the year column. Year is formatted well anywhere in the query, such as 2009. Why is - what happens at the command prompt when you choose multiple values in prompt dashboard?

    Thank you

    I think the YEAR Data Type could be defined DOUBLE RPD.

    Use the CAST function in the formula (fx) and the output from test.

    CAST (INT YEAR)

    Hope, it will help you.

  • I formatted my computer to windows xp, I have an acer aspire m5100 is the message I get [error number: 0x8024400A] the website has encountered a problem and cannot display the page you are trying

    I formatted my computer to windows xp, I have an acer aspire m5100 is the message I get [error number: 0x8024400A] the website has encountered a problem and cannot display the page you are trying

    Sasha,

    What browser (exact version). ?

    Harold Horne MVP on September 24, 2012

    0x8024400a

    You must be at Service Pack 3 level before you can use Windows updates.

    To determine which service pack is currently installed on your computer, follow these steps:

    1. on start and then click Run.

    2 copy and paste, or type the following command, and then click OK:

    winver

    A dialog box displays the version of Windows and the service pack that is currently installed on your computer.

    See also: http://support.microsoft.com/kb/2497281>

    You may be unable to access the Windows Update of Windows XP Web site.

    If you haven't already done so, you will need to install the SP2 and SP3 (SP1 note no longer exists).

    How to obtain the latest Windows XP service pack

    http://support.Microsoft.com/kb/322389>

    SP2 - http://www.microsoft.com/en-us/download/details.aspx?id=28>

    (for single PCs too)

    For Windows XP Service Pack 2 installation procedure

    http://support.Microsoft.com/kb/875364>

    Steps to take before you install Windows XP Service Pack 3

    http://support.Microsoft.com/kb/950717>

    It is stated in "How to obtain the latest service pack XP" is.

    If you have problems obtaining the service pack from Windows Update, you can download the package of standalone update from the Download Center.

    This page will say that this installation package is intended for it professionals and developers. However, you can download this file safely.

    The following file is available for download from the Microsoft Download Center:

    Download the Windows XP Service Pack 3 package now

    FIRST: Uninstall IE8 and IE7 if they are installed. Back to all the way back to IE6. You want other patches before you get those. Reboot after doing this.

    You are not the first to ask questions about how to upgrade a clean Windows XP - not even installation in the last week. In fact, I will just cut and paste my answer here... here:

    Get SP2 (manually) and save it to your desktop. (There's a link here.) [You are a COMPUTER professional for now.]

    Install it.

    Then restart at least a couple of times for a few minutes between each restart.

    Get SP3 (manually) and save it to your desktop. (There's a link here.) [You are a COMPUTER professional for now.]

    Install it.

    Then restart at least a couple of times for a few minutes between each restart.

    Download at least Internet Explorer 7 (if it is not Internet Explorer 8).

    Install it.

    Reset.

    Now, try to get the updates through the normal web page (http://windowsupdate.microsoft.com/) and see how much more you can get (100 +) and keep checking until you no longer have.

    Back - let everyone know if it worked for you.

        

    UTC/GMT is 14:12 on Sunday, October 28, 2012

  • A problem of time unusual Windows: time of Windows always comes back to the year 2005

    Specifications:

    Microsoft Windows XP Professional
    Version 2002
    Service Pack 3

    AMD Athlon XP 2700 +.

    At the start, and sometimes even if the computer is running, the windows of time always comes back to the year 2005, while maintaining the right hour, minute, second, day and month.

    I tried a number of solutions such as the "authoritative time server configuration", analysis of the computer for viruses and restarting the service of time via the command prompt, but without success. I am able to synchronize the time with a server, but only after the change of the year 2011.

    My installation of Windows is updated regularly and I'm always connected to the internet. I'm pretty sure that this is not a BIOS problem I replaced the CMOS battery and have ensured that the BIOS time is correct.

    In addition to the usual questions that arise in some programs due to an incorrect time, I noticed that when you use Firefox 4, the Google search engine always resets to "Instant Search" despite my having the clocks to the correct year.

    Any ideas?

    If I read your messages, I have that, amongst other times, pick up this always happens at startup.  This is the case, you can first check that the time is set correctly in the BIOS before you boot into Windows.  If it is, and, as you think, a program is causing this problem so the task is to know which.  A lot of startup programs each time you start Windows.  The boot configuration with minimum nude of running processes is called "Safe Mode".  So start your computer Safe Mode (press F8 as your computer starts).  When he arrives, check the date and time.  If it of OK and has not changed, then one of the other optional components must be the cause.  To narrow down that one, you can use "msconfig" to toggle the startup items groups until you find the one that is causing your problem.  The procedure for doing this is described in this article:

    "How to solve configuration errors by using the System Configuration utility in Windows XP"
      <>http://support.Microsoft.com/kb/310560 >

    I start by disabling everything in the "Startup" tab  If this solves the problem, then I start allowing things in this tab a little at a time until I have find the culprit. If the Startup tab does not resolve the problem, then I try disabling items in the tab "Services".  I usually start with non-Microsoft services.

    Of course on the machine who recently had this problem, you could try a shotgun approach and do a simple "System Restore" to a point in time before this problem.  It will probably fix the problem, but you will not know what caused it.

    "How to restore Windows XP to a previous state"
      <>http://support.Microsoft.com/kb/306084 >

    HTH,
    JW

  • Hello! I have a problem. The year will suddenly change Windows XP... Sometimes when I start the computer is the year 2095 chnged. What can I do about it?

    Why id the year change in windows XP?

    Hi Trubbe,
     
    Start with the setting of the time zone to the time zone where you live. Make sure then that "automatically adjust for DST' is checked.
     
    For more information, see:
     
     
    Which will probably fix the problem.
     
    However, here are two other things to consider:
     
     
    a. check your "input output system BIOS (Basic)" by going to the configuration to the computer he start.  Make sure that time is also set to what you want to be. Consult the manual for the computer to do the same thing.
     

    NOTE: BIOS change / semiconductor (CMOS) to complementary metal oxide settings can cause serious problems that may prevent your computer from starting properly. Microsoft cannot guarantee that problems resulting from configuration can resolved BIOS/CMOS settings. Changes to settings are at your own risk.

     
    b. make sure you have all the patches of Daylight Savings Time installed.  Since we are in the period that would normally be DST in any case, it is probably NOT part of the question, but it's a good belt/suspenders approach to take.

Maybe you are looking for