"format appears twice" in "to_date"

I have a C program running on UNIX. I am trying to insert a "timestamp" (year to seconds) from a host variable typed as VARCHAR. With "to_date(:varname,'MM-DD-YYYY HH:MM:SS')" inserted in the VALUES section, the "format appears twice" message appears. The text in the VARCHAR matches this format exactly.
How to fix? Oracle's insistence on denying what appears to be a valid format for a conversion is HIGHLY frustrating?

Thank you for a concise response that both fixes AND explains the problem. I had seen several responses on this site (which told me about the HH24 format), but gleaning the most useful information was difficult.

Similar Messages

  • ORA-01810: format code appears twice ORA-02063: preceding line from PULSARL

    Hi ,
    I am running this query
    select distinct to_char(a.USAGEDATE, 'dd/mm/yyyy hh:mm'),round((a.avgifoutoctets * a.numberofrows / (a.avgdeltatime * a.numberofrows) * 8 / 1000 ), 2)as avginoctetrate from vware.vhourlyrtgusageextract a ,vware.rtginterface b where a.id = b.ID and a.id = 125555 and a.USAGEDATE >= TO_CHAR(TO_DATE('2011-05-22 11:40:47', 'yyyy-MM-dd HH:mm:ss')) and a.USAGEDATE < TO_CHAR(TO_DATE('2011-05-29 11:40:47', 'yyyy-MM-dd HH:mm:ss')) and a.IFDESCRIPTION = 'Serial1/0' order by 1
    I am getting this exception
    ORA-01810: format code appears twice ORA-02063: preceding line from PULSARL
    Could anybody please tell me what is the issue ??

    Hi,
    The issue is:
    SQL> select TO_DATE ( '2011-05-29 11:40:47', 'yyyy-MM-dd HH:mm:ss') from dual;
    select TO_DATE ( '2011-05-29 11:40:47', 'yyyy-MM-dd HH:mm:ss') from dual
    ERROR at line 1:
    ORA-01810: format code appears twiceYou are using MM twice. MM means two digit months. You probably mean MI for minutes for the last one:
    SQL> select TO_DATE ( '2011-05-29 11:40:47', 'yyyy-MM-dd HH:mi:ss') from dual;
    TO_DATE(
    11-05-29
    SQL>Note that you have same mistake in your to_char as well, only this does not fail.
    The ORA-02063 just tells you that the error came from a different server, PULSARL, which means you must be selecting across a database link.
    Btw, what does this mean:
             AND a.usagedate >=
                   TO_CHAR (TO_DATE ( '2011-05-22 11:40:47', 'yyyy-MM-dd HH:mm:ss'))Why are you converting a string into DATE and then back into string? - What data type is usagedate?
    Regards
    Peter

  • Sqlplus query issue:customerID column appear twice

    I have tried in several ways to display a query where shows customer who have made more than 3 rentals from 01Nov to 31 Dec. However, for some reason the customerID column appear twice.
    ** I'm using 3 tables to get this result:
    select RentalAgreement.membershipcardid as "MCardID",
    customer.customerid,customer.cname,customer.address,
    membershipcard.customerid,invoice.rentc,RentalAgreement.DateAndTimeOfIssue,
    count(RentalAgreement.membershipcardid) as "NOfRents" from RentalAgreement,customer,membershipcard,invoice
    where rentalAgreement.membershipcardid=MembershipCard.MembershipCardID
    and customer.customerid = membershipcard.customerid
    and RentalAgreement.DateAndTimeOfIssue between '01-Nov-2012' and '31-Dec-2012'
    group by rentalAgreement.membershipcardid,MembershipCard.
    customerid,customer.cname,customer.address,invoice.rentc,customer.customerid,RentalAgreement.DateAndTimeOfIssue;
    MCardID CUSTOMERID CNAME ADDRES CUSTOMERID RENTC DATEANDTI
    NOfRents
    107 27 EDuois N151AS 27 60 11-NOV-12
    5
    108 28 WDuois N151AS 28 60 19-NOV-12
    5
    101 22 ALuois N193AS 22 60 22-NOV-12
    5
    MCardID CUSTOMERID CNAME ADDRES CUSTOMERID RENTC DATEANDTI
    NOfRents
    101 22 ALuois N193AS 22 60 21-NOV-12
    5
    101 22 ALuois N193AS 22 60 20-NOV-12
    5
    101 22 ALuois N193AS 22 60 24-NOV-12
    5
    MCardID CUSTOMERID CNAME ADDRES CUSTOMERID RENTC DATEANDTI
    NOfRents
    109 30 ADDuis N151AS 30 60 03-DEC-12
    5
    Thanks for your time.
    Im not sure if this query seems to be logic, I would appreciate any online guide for pl/sql

    Hi,
    978308 wrote:
    Hi
    Thank you for your answer. (I'm suing Oracle you're using (e.g. 11.2.0.1.0).
    sorry my question it wasnt not clear since I didn't attached my tables .
    As you suggested It is not necessary to use plsql, I tried to use the logic of algebra and old sql to solve query number 2: /* query No2
    produce a list of customers who have made more than three scotter rentals in the past 2 months
    show appropiate customer and rental agreement details*/
    However, I found many errors maybe because I my class diagram wasnt properly completed, So I decided to used plsql to get the result.
    It is true my query is incomplete because first of all I wanted to delete duplicate columns then I will work on number of ocurrences.
    If I delete and customer.customerid = membershipcard.customerid , sql will show 500 customers, the repetition is even higher. The condition "customer.customerid = membershipcard.customerid" in the WHERE clause looks right; you don't have to change that part.
    The SELECT clause determines what columns appear in the result set. If you only want customerid to appear in one column, then only include one customerid column in the SELECT clause. There need not be any connection between the SELECT clause and the WHERE clause; it's perfectly okay to use a column in the SELECT clause but not the WHERE clause, and it's perfectly okay to use a column in the WHERE clause but not the SELECT clause.
    /* query No2
    produce a list of customers who have made more than three scotter rentals in the past 2 months
    show appropiate customer and rental agreement details*/Once again, please format your code, and use \ tags when you post it here to preserve the spacing.  It's hard to read informatted queries like this, and therefore it's hard to debug them.
    See the forum FAQ {message:id=9360002}
    select RentalAgreement.membershipcardid as "MemberID",
    customer.customerid,
    customer.cname,
    customer.address,
    membershipcard.customerid,
    RentalAgreement.DateAndTimeOfIssue,
    RentalAgreement.EScotterID,
    count(RentalAgreement.membershipcardid) as "NumberOfRent"
    from RentalAgreement,customer,membershipcard
    where rentalAgreement.membershipcardid=MembershipCard.MembershipCardID
    and customer.customerid = membershipcard.customerid
    and RentalAgreement.DateAndTimeOfIssue between '01-Nov-2012' and '31-Dec-2012'Once again, don't compare a DATE (such as RentalAgreement.DateAndTimeOfIssue) to a VARCHAR2 (such as '01-Nov-2012').  You're using TO_DATE correctly in your INSERT statements; use TO_DATE in the query, too.
    group by rentalAgreement.membershipcardid,
    MembershipCard.customerid,
    customer.cname,customer.address,
    RentalAgreement.EScotterID,
    customer.customerid,
    RentalAgreement.DateAndTimeOfIssue;"GROUP BY a, b, c, d" means that each row of output will represent a distinct combination of columns a, b, c and d, and aggregate functions will operate on the whole group.  In the query above, that means count(RentalAgreement.membershipcardid) will show the number of rows that had a value for membershipcardid for each combination of the 6 columns listed in the GROUP BY clause, including custiomerid and dateandtimeofissue.  That means that rentals for each customer *and date* will be counted separately.  Look at the output you're getting from query 2:Member CUSTOMER CUSTOMER DATEANDTIME ESCOTTER Number
    ID ID CNAME ADDRES ID OFISSUE ID OfRent
    102 23 BLuois N113AS 23 11-Nov-2012 1 1
    101 22 ALuois N193AS 22 21-Nov-2012 1 1
    101 22 ALuois N193AS 22 24-Nov-2012 5 1
    101 22 ALuois N193AS 22 20-Nov-2012 2 1
    101 22 ALuois N193AS 22 22-Nov-2012 4 1
    101 22 ALuois N193AS 22 19-Nov-2012 2 1
    The count is always 1.  That is, customer 22 did have 5 rentals, but only 1 rental per day.
    You haven't posted the results you want from the same data.  I'm guessing you want something like this:Member CUSTOMER DATEANDTIME ESCOTTER Number
    ID ID CNAME ADDRES OFISSUE ID OfRent
    101 22 ALuois N193AS 19-Nov-2012 2 5
    101 22 ALuois N193AS 20-Nov-2012 2 5
    101 22 ALuois N193AS 21-Nov-2012 1 5
    101 22 ALuois N193AS 22-Nov-2012 4 5
    101 22 ALuois N193AS 24-Nov-2012 5 5
    showing that that customer 22 had 5 rentals in the period of interest.  That is, you *do* want to combine all rows for a customer when COUNTing, but you *don't* want to combine the rows when displaying.  The aggregate GROUP BY combines the rows, so how can you still get the details (such as date and scooter ID) for each separate rental?  One way is to do a GROUP BY just to get the customerid and COUNT, and use that in an IN subquery (or maybe a join), where the main query does not use GROUP BY.
    If this is a school assignment, I don't want to ruin it for you, so I'll use an example with the scott.dept and emp tables.  Say we want to find which departments have mor than 1 CLERK working in them.  One way to do that is:SELECT     *
    FROM     scott.dept
    WHERE     deptno     IN (
              SELECT deptno
              FROM      scott.emp
              WHERE      job     = 'CLERK'
              GROUP BY     deptno
              HAVING     COUNT (*)     > 1
    Output:DEPTNO DNAME LOC
    20 RESEARCH DALLAS
    Another, com pletely different way would be to use the analytic COUNT function, not the aggregate function.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Why report section is appearing twice in the output of report designer

    Hi Gurus,
    I have created a report in the report designer and my report contains 5 sections.
    each report section is one query view.
    i inserted all the query views and done some formatting .
    but when i executed the report , one of the report section is appearing twice in the output.
    ex: i need the output like this
    section1
    section2
    section3
    section4
    section5
    But the output i am getting is as follows.
    section1
    section2
    section3
    section3
    section4
    section5
    report designer experts can please let me know why this problem is coming and also please provide possible solution for this.
    Thanks in advance.
    Raj.

    Hi Gurus,
    I have created a report in the report designer and my report contains 5 sections.
    each report section is one query view.
    i inserted all the query views and done some formatting .
    but when i executed the report , one of the report section is appearing twice in the output.
    ex: i need the output like this
    section1
    section2
    section3
    section4
    section5
    But the output i am getting is as follows.
    section1
    section2
    section3
    section3
    section4
    section5
    report designer experts can please let me know why this problem is coming and also please provide possible solution for this.
    Thanks in advance.
    Raj.

  • Lync 2013 user appears twice in Lync, once with all features, a second time with only the option to make a voice call

    Hi,
    I'm using 15.0.4551.1007.
    A user appears twice in my contact search but in the second instance he has a phone icon and I can only make a video call to the user.
    His contact card only shows a phone number in 'Other'.  The number appears in his other contact card but not in the same format.
    I suspected he is somewhere in my contacts but a search found nothing.  He's not listed twice in the Exchange GAL either.
    Where can Lync be getting this information?  it doesn't happen to every user and he's enabled the same way as everybody else in Lync.
    Thanks,
    rudif

    Open Lync option, click Personal tab. Choose None under Personal information manager.
    Then sign out and sign in to check if you can see the contact twice for the specific user.
    Please also check if other users have this issue. If they do have, the problem locates on the address book server or Active Directory.
    If only you have this problem, try to delete the Lync cached file for you user.
    Lisa Zheng
    TechNet Community Support

  • Parameter appears twice (discoverer 10g)

    I was asked to make a change in an existing report. The report consists of two sheets with similar data. One sheet shows the data in dollars, the other sheet shows the data in pounds. Even though each sheet comes from a different folder, the parameters have the same name.
    I noticed that the pound sheet has the parameter "from designation" appearing twice, as well as the "to designation" parameter. Since the same name parameter also appears in the dollar sheet, I was sure that I would find the condition of each parameter activated. However, only the pound condition is active, with the other sheet's dollar condition not active. If I de-activate it from the sheet, the parameters do not appear. When I activate the parameters, they again appear twice.
    I prefer not deleting and redefining the parameters. Has anyone encountered this problem before?
    Thanks.
    Leah

    The sheets are using different folders.
    I do need to have different parameters passed to the second sheet from what was passed in the first sheet. This is intended design. For example:
    Sheet 1 parameters:
    Cost Center (with an option to select ALL cost centers)
    Year
    Summary sheet shows dollars for the year (cross-tab format) broken down by period across the top, and individual cost centers; with SUMs for YTD and at the bottom of each period.
    The detail data is in a data warehouse, and I need parameters to pass to the BA folder that tells the query whether the user choose to drill down on an individual cost center for a period, or the total of all cost centers for a period (just an example). So.... behind the scenes I have a calculation that says:
    DECODE(INBA Journal Rollups.Security Bucket,'ONE',INBA Journal Rollups.Company Cost Center,' <ALL>')
    I don't want the <ALL> or ONE to appear on the first (summary) sheet, but so far I am unable to pass the value of this calculation into the detail sheet parameter if I am not showing the calculation on the summary sheet.
    Thanks again for your help.
    Suzanne

  • The names of the bookmarks in the bookmark toolbar appear twice.

    This just started yesterday. On my bookmarks toolbar, the names of each bookmark appear twice. For example, my CNBC bookmark now says CNBC CNBC. All of them have taken on this format. I've tried renaming them, deleting them, removing toolbar and putting it back on, nothing seems to work. They always come back with double names. Any help would be appreciated!

    If you only want the names of the bookmarks then export the bookmarks to an HTML file and open that file in Firefox and copy and paste the text (Ctrl +A and Ctrl +C) to a plain text editor like Notepad that doesn't know about HTML code.

  • Text appears twice after exporting

    On a video that I am working on there is a section with some scrolling text. It appears fine in FCE but after I export it with quicktime conversion it seems to appear with a ghost image right after it. All of the text appears twice and the second one is quite a bit fainter.
    Is it a problem with my conversion settings?
    Thanks for any help.

    I thought that somebody would at least know if it was possible to create a problem like this by setting something wrong in the conversion settings. Or that they would know the specific setting that would cause it. In which case they could just tell me what that specific setting was and there would be no need for me to type all of them out.
    Formatted for Quicktime Movie
    Compression: H.264
    Key frame rate: 24
    Frame reordering: yes
    Encoding mode: multi-pass
    Dimensions: 853x480 (custom)
    De-interlaced

  • SCCM 2012 SP1 - Software Center appears twice in Start Menu

    Hi guys,
    i just finished implementing a fresh SCCM 2012 SP1 Installation for a customer. The whole OSD works like a charm (except some issues with the latest Windows updates breaking the whole OSD, will open a separate thread for this soon), but after the deployment
    the Software Center is appearing twice in the Start Menu (We're using Win7 Enterprise SP1 x86 English with 5 integrated language packs). I first thought this has something to do with the integrated language packs, but both Start Menu entries
    are always in the same language.
    The strange Thing is, that one entry for the SCCM Software Center is called "Software Center" and the other one "SoftwareCenter" (without a space). We configured 2 Client policies, one with EP-enabled and one without EP. We
    deployed the Client Settings to different collections so i don't think that this is causing the Problem?Do you guys have any idea why this is Happening?
    Has anyone ever seen this? See a screenshot below:
    Thank you.
    Cheers
    Stefan

    Thanks for your Response Thomas.
    I don't think it is related to the upgrade to SP1.I think it might be a General issue in SP1. I started with a fresh SCCM 2012 SP1 Installation and i also have 2 Software Center entries in my start menu. If i check the shortcut i can see that one shortcut
    was created when i captured my base Image, the other one was created during the Install OS Task Sequence.

  • Same genre appears twice in my iPhone 5s.

    Why does the same genre (Alternative) appear twice in my iPhone 5s. Both Genre listings in the phone show the same # of songs and minutes.
    What I've done thus far:
    1. removed "Alternative" genre from all songs in music library
    2. synced iPhone and both Alternative Genre we removed on iPhone under Genres
    3. made sure the Genre spelling on all songs is correct and the same in iTunes
    4. re-synced iPhone and again both Genres Alternative appear.
    Then tried this:
    2. connected iPhone to iTunes, went to iTunes / iPnone > settings > music and verified under "Genres" that Alternative only appears once in the Genres section
    3. on the iPhone settings > music > insured "Show All Music" was turned off
    4. on the iPhone settings > iTunes & App Store insured "Show All" > music was turned off
    5. unchecked Sync Music and selected remove all music then synced iPhone, verified all music and all Genres on the iPhone were removed
    6. ejected iPhone did a hard reset on iPhone verified both "Alternative" Genres were deleted.
    7. connected iPhone to iTunes, went to iTunes / iPnone > settings > music and re-selected Sync Music and synced
    8. STILL TWO LISTINGS OF ALTERNATIVE GENRE ON IPHONE AND HAS THE SAME # OF SONGS AND MINUTES.
    * note no other Genres have duplicate listings and there are a total of 9 other Genres. Of those 3 are custom names.
    Help please...
    Thank you in advance.

    Is the phone unlocked and available to you? Have you notified your carrier of this change?

  • Loops appear twice in the loop browser. Huh?

    I just installed iLife '06 and have been "messing around" with the various programmes. One thing I noticed was that exactly the same loops appear twice in the loop browser. Not all loops are doubled, which is obviously what is confusing me. Is this normal (not my confusion!!)?
    I've checked the folder in the library and each loop is only available once, but GarageBand insists on having two of quite a number of loops. Any tips would be greatly appreciated, as I haven't found any way to delete just one of the loops (deleting the file obviously deletes both . . .)
    Thanks in advance,
    Steve
    G5 Dual 2.3, G4 Powerbook   Mac OS X (10.4.3)  

    Do you really have only one copy of each? Do a Finder/Spotlight search. There are several places where the loops could show up:
    - the general Library/Audio folder
    - the user Library/Audio folder
    - the general Library/Application Support folder
    - the User Library/Application Support folder
    Did you install over an old version of GB? That might explain the duplicate loops. And the "single" loops that were either part of your old installation and not of GB3 or vice versa.
    In order to repair that, you should trash the duplicate loops and the content of the Loops Index folder and then drag the remaining loops into the loop browser.

  • How can I manage six email accounts WITHOUT them all appearing (twice) in the Folders column?

    How can I manage six email accounts WITHOUT them all appearing (twice) in the Folders column?
    All I need is ONE INBOX (like Windows Mail used to do) ...
    I can see in the 'Account' column of each message which email account it's using.
    Then, I either junk or read the message, followed by delete or file to one of my created folders.
    As it is, half my page is depth is taken up by 12 lines of Account names !!!

    That still leaves SIX lines of Account names down the side. All I want is ONE INBOX ... (I can see which account each message belongs to in the 'Account' column...)

  • Time Capsule appears twice in Airport drop down menu

    Menu Bar > Airport drop-down menu: My Time Capsule's wireless name shows up twice in my list of wifi sources. Once in the group with all the other routers and again in a group called "Devices".
    Long story short…
    I start with a perfectly functional, WPA/WPA2 password-protected Time Capsule: Over a year old. Two MbP's using it for Time Machine backup. Connected to a 1.5TB MyBook external HD via usb. Doubles as my wifi router. Everything's connected to it, including my wifi-enabled printer. Works great. No issues.
    I get this idea in my head that I need to hide my wifi signal. I figure it out and ¡Viola! Hidden. Then I try to add my wifi-enabled printer to the list of allowed devices in "Access Control". I hit a big snag and can't figure out how to get it to connect (btw, don't buy a Brother printer. Pure crap). So, I give up and revert permissions back to visible, password-protected state.
    Skipping irrelevant issues that I already resolved, I now have the wireless name of my Time Capsule appearing twice in the airport drop down menu. It appears with all the other wifi sources my machine detects AND appears at the bottom under a new category called "Devices".
    All I want is to have things back the way they were and this anomaly in the drop down menu is a constant reminder that I #1 failed and #2 bought a crap printer.
    (Long story long, I guess. Sorry.) How do I delete this "Devices" group from the airport drop down menu?

    Stilts McCoy wrote:
    Menu Bar > Airport drop-down menu: My Time Capsule's wireless name shows up twice in my list of wifi sources. Once in the group with all the other routers and again in a group called "Devices".
    You might find useful advice in this thread:
    http://discussions.apple.com/message.jspa?messageID=12156248
    If you want to post a reply, please do so to this thread, not the other one.

  • Long text for line item appears twice in my PO form...

    Hello Experts,
    I am wondering why my long text for my 1st line item is appearing twice. In my PO, I only
    maintained a long text for my 1st PO line item appeards twice. below is my code:
    /E          ITEM_LINE_1
    IZ           &EKPO-EBELP&,,&EKPO-TXZ01&
    IZ           ,,&EKPO-EMATN&,,&EKPO-MENGE&,,&EKPO-MEINS&,,&EKPO-UMREZ&,,&EKPO-NETPR&,,
    =           &EKPO-NETWR&
    /:           DEFINE &LV_TEXTNAME& = ''
    /:           PERFORM GET_LONGTEXT_ITEM IN PROGRAM ZMMRP0008
    /:           USING &EKPO-EBELN&
    /:           USING &EKPO-EBELP&
    /:           CHANGING &LV_TEXTNAME&
    /:           ENDPERFORM
    /:           INCLUDE &LV_TEXTNAME& OBJECT 'EKPO' ID 'F01'
    The element 'ITEM_LINE_1' is called per line item. So in my case, 3 times. The INCLUDE statement
    at the end of the element is for the longtext. I am now confused as to why it appears twice for the 1st line item.
    Thank you guys and take care!

    Hi,
    You can debug and check whats happening there.
    Regards,
    Ram

  • Duplicate entries / Employee is appearing twice in report (OR more than onc

    Duplicate entries / Employee is appearing twice in report (OR more than once)
    When I hire an employee, I assign the position, and based on the positions other values get defaulted /assigned to that employee.
    I have one case where employee has been assigned to one position, but with different position descriptions, and in report it is showing duplicate entries for the same personnel number, now client need for one personnel number only one row to display in report
    Also I tries to run , Birthday list standard report , it is also showing 2 entries (Or sometime more than 2)for the same personnel number , May I know why this is happening?
    And how to fix this bug
    Thanks and Regards
    Jaydeep Jadhav

    Hi,
    Can you check where the code is written to get employees from position, there may be two cases where multiple records exists for single person.
    1) When getting data for pernr assigning to a position they may missed out date condition. If so we need to bring only active positions assigned to that employee.
    2) There may be multiple positions assigned to a single person. In this case you need to ask the client what you need to do.
    Delete adjacent duplicate is may  not be correct solution as which position we need to delete is not sure. You check above two cases and go head.
    Hope this information will help you.
    Regards,
    Narendra.Soma

Maybe you are looking for