Whats wrong with this query.can anyone help me......

select CASE WHEN TO_NUMBER(SUBSTR(TO_CHAR(START_TIME_TIMESTAMP,'DDMMYYYY HH24:MM:SS'),13,2))>0 AND TO_NUMBER(SUBSTR(TO_CHAR(START_TIME_TIMESTAMP,'YYYYMMDD HH24:MM:SS'),13,2)) <14
THEN TO_DATE(CONCAT(SUBSTR(TO_CHAR(START_TIME_TIMESTAMP,'YYYYMMDD HH24:MM:SS'),13,2)||'00',SUBSTR(TO_CHAR(START_TIME_TIMESTAMP,'YYYYMMDD HH24:MI:SS'),16)||'00'),'DD-MM-YYYY HH24:MI:SS') end
from table;
i have written this query.whats wrong with this query..........
the error is "literal does not match format string"
Reegards soumen

Why does your date_format loose, ununify and not fix ?
And what is your exact requirement?
>>
CASE WHEN
TO_NUMBER(SUBSTR(TO_CHAR(START_TIME_TIMESTAMP,'DDMMYYYY HH24:MM:SS'),13,2))>0
AND TO_NUMBER(SUBSTR(TO_CHAR(START_TIME_TIMESTAMP,'YYYYMMDD HH24:MM:SS'),13,2)) <14
<<
This is
CASE WHEN TO_CHAR(START_TIME_TIMESTAMP,'MM') between '01' and '13'
>>
THEN TO_DATE(CONCAT(SUBSTR(TO_CHAR(START_TIME_TIMESTAMP,'YYYYMMDD HH24:MM:SS'),13,2)
||'00',
SUBSTR(TO_CHAR(START_TIME_TIMESTAMP,'YYYYMMDD HH24:MI:SS'),16)||'00'),
'DD-MM-YYYY HH24:MI:SS')
<<
This is
TO_DATE(
TO_CHAR(START_TIME_TIMESTAMP,'MM"00"SS"00"),
'DD-MM-YYYY HH24:MI:SS')
Obviously, format is not matching !
SQL> select to_char(sysdate,'MM"00"SS"00') from dual;
TO_CHAR(
06004900
SQL> select to_date('06004900','DD-MM-YYYY HH24:MI:SS') from dual;
select to_date('06004900','DD-MM-YYYY HH24:MI:SS') from dual
ERROR at line 1:
ORA-01861: literal does not match format string

Similar Messages

  • Whats Wrong with this query

    SAMPLE DATA
        CT_NO   RENT_NO DUE_DATE    DUE_AMT
         2233         1 11-SEP-06     11800
         2233         2 11-OCT-06     11800
         2233         3 11-NOV-06     11800
         2233         4 11-DEC-06     11800
         2233         5 11-JAN-07     11800
         2233         6 11-FEB-07     50000
         2233         7 11-MAR-07     11800
         2233         8 11-APR-07     11800
         2233         9 11-MAY-07     11800
         2233        10 11-JUN-07     11800
         2233        11 11-JUL-07     11800
         2233        12 11-AUG-07     50000
         2233        13 11-SEP-07     11800
         2233        14 11-OCT-07     11800
         2233        15 11-NOV-07     11800
         2233        16 11-DEC-07     11800
         2233        17 11-JAN-08     11800
         2233        18 11-FEB-08     50000
         2233        19 11-MAR-08     11800
         2233        20 11-APR-08     11800
         2233        21 11-MAY-08     11800
         2233        22 11-JUN-08     11800
         2233        23 11-JUL-08     11800
         2233        24 11-AUG-08     50000
         2233        25 11-SEP-08     11800
         2233        26 11-OCT-08     11800
         2233        27 11-NOV-08     11800
         2233        28 11-DEC-08     11800
         2233        29 11-JAN-09     11800
         2233        30 11-FEB-09     50000
         2233        31 11-MAR-09     11800
         2233        32 11-APR-09     11800
         2233        33 11-MAY-09     11800
         2233        34 11-JUN-09     11800
         2233        35 11-JUL-09     11800
         2233        36 11-AUG-09     50000
         2233        37 11-SEP-09     11800
         2233        38 11-OCT-09     11800
         2233        39 11-NOV-09     11800
         2233        40 11-DEC-09     11800
         2233        41 11-JAN-10     11800
         2233        42 11-FEB-10     50000
         2233        43 11-MAR-10     11800
         2233        44 11-APR-10     11800
         2233        45 11-MAY-10     11800
         2233        46 11-JUN-10     11800
         2233        47 11-JUL-10     11800
         2233        48 11-AUG-10     50000
    My QUERY
    select
    count(distinct(case when b.due_date <='15-feb-2010' then b.rent_no else 0  end))ovd_due,
    SUM(case when rcv_dt is null or RCV_DT>'15-feb-2010'
                     THEN due_amt
    else 0
                END) Rent_Bal
    from le_dues b
    where ct_no=2233
    my result from the query
      OVD_DUE  RENT_BAL
           43    159000here we can see tha OVE_DUE should be 42 but my query is returning 43....WHY
    please correct my query.

    Hi,
    It looks like 43 is the correct answer. The distinct values you are counting are all the integers from 0 through 42 inclusive.
    Don't compare DATEs to strings. For example
    when b.due_date <='15-feb-2010' is asking for trouble. Use TO_DATE or a DATE literal:
    when b.due_date <= DATE '2010-02-15' instead.
    If you don't want to count 0, don''t include 0 in the list of things to be counted.
    COUNT ( DISTINCT CASE
                   WHEN  b.due_date <= TO_DATE ( '15-feb-2010'
                                  , 'DD-Mon-YYYY'
                   AND   b.rent_no != 0     -- If needed (probably not; unclear from example)
                   THEN  b.rent_no
               END
          )     AS ovd_due,

  • I have lost my itunes icon from my desktop. I have recently downloaded windows 9 and thought maybe this had something to do with it. Can anyone help me get it back?

    I've lost my itunes icon from my desktop and can't see it anywhere else. I have recently upgraded to windows 9 and thought maybe this had something to do with it. Can anyone help please?

    Has iTunes been uninstalled or removed from you system?
    Is it no longer in the Start Menu or in Control Panel?
    What exactly was downloaded and installed?  There is no Windows 9, so it's not possible that it is installed on your computer.

  • CAN ANYBODY TELL ME WHAT WRONG WITH THIS RSS FEED IT WONT WORK

    CAN ANYBONE TELL ME WHATS WRONG WITH THIS FEED BECAUSE IT WONT WORK AND ALSO HOW DO I GET A LINK TO THE PODCAST RSS FEED FOR THE SUBMIT PODCAST PAGE ON ITUNES,
    ANY HELP WILL BE MUCH APRECIATED
    <?xml version="1.0" encoding="UTF-8"?>
    <rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
    <channel>
    <title>DJ Hybrid Coventry Drum n Bass Podcast</title>
    <link>http://www.djhybridcoventry.com/podcast.htm</link>
    <language>en-us</language>
    <copyright>℗ & © 2007 DJ Hybridb& </copyright>
    <itunes:subtitle>DJ Hybrid Drum n Bass Podcast brings you all the latest and greatest from the Drum n Bass scene, updated every two weeks</itunes:subtitle>
    <itunes:author>DJ Hybrid</itunes:author>
    <itunes:summary>The DJ Hybrid Coventry Drum n Bass Podcast will showcase a selection of the latest and greatest tunes that are getting rinsed on the scene, mixed down with sharp cuts and nasty double drops by Dj Hybrid the podcast will also feature other DJ's and Mc's on different shows. Updated every two weeks this is guarenteed to be an original style of drum n bass mashup, for more info check www.djhybridcoventry.com</itunes:summary>
    <description>DJ Hybrid Drum n Bass Podcast brings you all the latest and greatest from the Drum n Bass scene, updated every two weeks</description>
    <itunes:owner>
    <itunes:name>DJ Hybrid</itunes:name>
    <itunes:email>[email protected]</itunes:email>
    </itunes:owner>
    <itunes:image href="http://i100.photobucket.com/albums/m8/djhybrid/PODCASTLOGOBLUE.jpg" />
    <itunes:category text="Music">
    <itunes:category text="Drum n Bass"/>
    </itunes:category>
    <itunes:category text="music"/>
    <item>
    <title>DJ Hybrid Podcast - 1st Show 03/6/07</title>
    <itunes:author>DJ Hybrid</itunes:author>
    <itunes:subtitle>The first show of the new drum n bass podcast from DJ Hybrid</itunes:subtitle>
    <itunes:summary>Welcome to the 1st show from DJ Hybrid because its the first show im goin to play what tunes i think represent me as a DJ aswell as my favourite drum n bass tunes at the moment for tracklistings check www.djhybridcoventry.com</itunes:summary>
    <enclosure url="http://fs06n5.sendspace.com/dl/603942da730253766c5157920e810d3e/46771dd931 3f824d/v3adp4/DJ%20Hybrid%20Podcast%201%20%20-%20%203rd%20June%202007.mp3" length="8727310" type="audio/x-m4a" />
    <guid>http://fs06n5.sendspace.com/dl/603942da730253766c5157920e810d3e/46771dd9313f824d /v3adp4/DJ%20Hybrid%20Podcast%201%20%20-%20%203rd%20June%202007.mp3</guid>
    <pubDate>Sun, 03 Jun 2007 20:00:00 GMT</pubDate>
    <itunes:duration>53:36</itunes:duration>
    <itunes:keywords>DJ, Hybrid, Podcast, Drum, Bass, Jungle, Coventry, Double Drop, Latest, Tunes, Vinyl, Liquid, Rave, Reggae, Urban</itunes:keywords>
    </item>
    </channel>
    </rss>

    First...Stop screaming. It's rude.
    Next...there are some minor problems with your feed. "Drum n Bass" is not a iTunes category. Stick with <itunes:category text="Music" /> remove the others.
    Not required, but recommend to add an <itunes:explicit> tag with a Y or N depending on what suits your podcast. The iTunes staff will remove your feed if it isn't tagged properly.
    MP3 audio files should have a type="audio/mpeg".
    Keep the Podcast spec handy...the categories and other info listed in the spec.
    Test your feed with http://www.feedvalidator.org it will point out problems with your feed.
    The bigger problems stem from your podcast enclosure, specifically the URL.
    The URL you have listed to the podcast mp3 apparently has changed so iTunes can't download the file. It also appears that you are using a "free download" kind of service that uses web page based downloads, which might account for why the URL keeps changing. Don't think that iTunes will be able to properly download the file.
    Erik

  • I tried to restart my ipad.  Instead of the apple logo coming up, the wheel is up and has circled for hours.  I don't know what to do about this.  Can anyone help? Thanks.

    I tried to restart my ipad.  Instead of the apple logo coming up, the wheel has circled for hours.  I don't know what to do about this.  Can anyone help?  Thankis.

    Hard Reset.
    - Hold down the Home Button (Circle button with White Square in it)
    - Wait for the 'Slide to Unlock' screen pops up
    - Test to see if the issue is resolved.

  • I'am getting an update error when am trying to upgrade to newer version (4.3.2)..the error message content shows that i tunes could not back up the i pod,because the back up was corrupt or not compatible with ipod..can anyone help me out to fix this issue

    I'am getting an update error when am trying to upgrade to newer version (4.3.2)..the error message content shows that i tunes could not back up the i pod,because the back up was corrupt or not compatible with ipod..can anyone help me out to fix this issue

    Hi,
    Try here:  http://support.apple.com/kb/HT1808. 
    Hope this helps! 
    ---likeabird---

  • I just bought a new iMac and am having troubles downloading creative cloud installer.  Its coming up with error 214 - I can't find any solutions for this.  Can anyone help me?  Im on mac OS 10.9.4

    I just bought a new iMac and am having troubles downloading creative cloud installer.  Its coming up with error 214 - I can't find any solutions for this.  Can anyone help me?  Im on mac OS 10.9.4

    Meg81 error 214 indicates a download data validation error.  This means that the update you downloaded became corrupted likely during the download process.  I would recommend utilizing the suggestions listed in Error downloading Creative Cloud applications - http://helpx.adobe.com/creative-cloud/kb/error-downloading-cc-apps.html to attempt to improve the stability of your Internet connection.
    You can also find information on how to review your download logs which may provide additional information regarding the failure of the download.

  • When i use the apple store, Your request is temporarily unable to be processed. what is wrong with it? can someone help me?

    when i use the apple store, Your request is temporarily unable to be processed. what is wrong with it? can someone help me?

    Try turning off the Firewall in System Preferences > Security (or Security & Privacy) > Firewall
    Disable anti virus software if you have that installed before downloading media from the App Store.
    When you post for help, please tell us which Mac OS X you have installed. Thanks !

  • I am not able to see the airplay icon with Maverick. Can anyone help on how to go about this?

    I am not able to see the airplay icon with Maverick. Can anyone help on how to go about this?

    Does restarting the router help?
    Best.

  • Does ANYONE know whats wrong with this program?!?!

    Hey(again),
    Does anyone know whats wrong with this program?:
    public class FloatingNumbersTest
    public static void main(String args[])
    float float1 =50.0f;
    float closeFloat=0.001f
    float farfloat=100.0f
    if (float1<=closeFloat)
    System.out.print("Float1 pretty close to zero");
    if (float1>=closeFloat)
    System.out.print("Float1 is near 0");
    if (float1>=farfloat)
    System.out.print("Float1 is not even close to zero!"0
    }There has seemed to be 5 errors!

    public class FloatingNumbersTest
    public static void main(String args[])
    float float1 =50.0f;
    float closeFloat=0.001f
    float farfloat=100.0f
    if (float1<=closeFloat)
    HERE        System.out.print("Float1 pretty close to zero");
    if (float1>=closeFloat)
    System.out.print("Float1 is near 0");
    if (float1>=farfloat)
    System.out.print("Float1 is not even close to zero!"0
    }you're missing the opening { for the first if.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • My macbook pro is connected to internet via my time capsule but my iPad and iPhone won't. it shows wifi connection to the time capsule but when i go on to the internet on the iPad or iPhone, it comes up with network error. can anyone help?

    my macbook pro is connected to internet via my time capsule but my iPad and iPhone won't. it shows wifi connection to the time capsule but when i go on to the internet on the iPad or iPhone, it comes up with network error. can anyone help?

    This can be caused by a number of issues.
    Was everything working and then suddenly stopped??
    Or is this a new clean setup and has never worked.
    Do you have a cable modem which is not a router and the TC setup in bridge? That will cause it. The TC must be in router mode, ie dhcp and nat.
    Check the IP the MBP gets including dns and gateway..
    Then check the ipad/iphone.. post what IP dns and gateway (router in applespeak) they get.

  • What wrong with this?

    I have a video that has sound, I brought it into afteraffects, made a composition and made some changes. I exported the composition (rendered it) for quick time to edit in photoshop - the video is about 7 minutes.
    Playing the video there is no sound....why?
    Bringing the video into photoshop for editing with content aware fill creates 500+ frames......is that normal?
    also whats the easiest way to move between aftereffects and photoshop in terms of editing frames? can I make changes in photoshop and watch it update in after effects?

    What wrong with this?
    Everything! Sorry, it's simply the most ill-conceived workflow I could imagine.
    Playing the video there is no sound....why?
    http://forums.adobe.com/thread/426347?tstart=0
    Bringing the video into photoshop for editing with content aware fill creates 500+ frames......is that normal?
    Yes. All video editing in PS is limited to 500 or 1000 frames, repsectively. There is no way to extend that range. Read the PS help!
    also whats the easiest way to move between aftereffects and photoshop in terms of editing frames?
    You don't. What you have in mind won't work, anyways. Content Aware Fill only works per frame and has no temporal stabilization, so each frame will have a different pattern and the resulting animation would flicker and wobble.
    can I make changes in photoshop and watch it update in after effects?
    That's what use File --> Reload Footage for or simply close and reopen the project.
    Mylenium

  • HT201303 An unknown error has occurred when trying to sign in , and I know I putting in the correct info, this stinks can anyone help? Because apple isn't...

    An unknown error has occurred when trying to sign in , and I know I putting in the correct info, this stinks can anyone help? Because apple isn't...

    urgh... just noticed my previous post said i have mountain lion... i meant that i have snow leopard.  no idea why i messed that up!
    anyway, i just tried reinstalling snow leopard from the usb key that came with the computer. Then, I installed software updates until it told me there were no more updates. After that, I tried the app store again, and it still is giving me the unknown error. really irked by that. may have to take it back to the apple store yet again, to see if i can figure out why the app store won't work.

  • I just installed itunes 11.1.5.5.  Now the format in Itunes is changed.  when I am trying to add music to my iphone, there is no longer an add button under the Iphone device.  Why did they have to change this?  Can anyone help, Im tryiong to add music.

    How do you add musci to the Iphone?  I just installed itunes 11.1.5.5.  Now the format in Itunes is changed.  when I am trying to add music to my iphone, there is no longer an add button under the Iphone device.  Why did they have to change this?  Can anyone help, Im tryiong to add music.

    Correct.  When you purchase devices, they would have stated the OS they needed to work, on the box.  This can be overlooked, but it is very important to check when purchasing. 
    You current OS, is so old, that they technology build into the new devices, is not something your OS understands.  It didn't exist when your OS was created, and therefore you need to upgrade the OS to work with the newer technology of these devices.
    10.6 software is not downloadable.  You must purchase a DVD disc.  You can order it from the on-line apple store
    - http://store.apple.com/us/product/MC573/mac-os-x-106-snow-leopard.

  • HT2242 I am British, live in Spain, and want to use my UK credit card for my iTunes account and use English, but can't find a way to do this. Can anyone help?

    I am British, live in Spain, and want to use my UK credit card for my iTunes account and use English, but can't find a way to do this. Can anyone help?

    under usage-i only have the camera roll, photo library and photostream-they don't show the individual albums withing my libraries-if i delete library-i would delete about 12 albums
    I don't sync pics but was hoping the albums showed up there.  It was a long shot.

Maybe you are looking for

  • Several dates in the same field and table

    Hey! I need dates of different work phases, in order to calculate the duration of each phase separately in SAP-Query. The dates are situated in the same tables and fields (f.ex. actual start dates of work phase 1, phase 2, phase 3, etc. are all locat

  • Organizing photos in Aperture?????

    I am trying to organize the projects and albums that are located on the left hand side of the screen when using Aperture.  You can arrange the projects and albums by name, manual, or kind when you use the preferences drop down menu located below the

  • Safari too slow - help finding a bug?

    Hi all, Sorry for such a noob question, this is a problem I never have myself. My wife's iMac (10.4) is running Safari extremely slow. This occurred when we were out of town and our inlaws were house-sitting. My inlaws have been known to (inadvertent

  • Enhanced rebates implementation

    Hi Gurus . We are upgrading our current architecture from regular rebates to extended / enhanced rebates functionality. Currently we are creating orders and invoices in ECC and calculation of accruals happens in both ECC and CRM. However while downlo

  • Can't update to version 2.0.1

    I am running OSX 10.4.3. After downloading Safari 2.0.1, I am unable to install it, the error message being that I need 10.4.2 on my HD. Does this update not work with 10.4.3, but only with 10.4.2? Any suggestions would be appreciated.