Between and operator is not working

Oracle 10g
Hi
SELECT to_char(reportingdatetime,'DD-MON-YYYY HH24:MI:SS'), code, description, details, processname, instanceid, order_number,upi,reference
FROM XXHDNL_INT_HUB_ERROR_DETAILS
where
to_char(reportingdatetime,'DD-MON-YYYY HH24:MI:SS') between '30-NOV-2010 06:00:00' and '01-DEC-2010 05:59:59'
and
CODE ='2M-4103'
I am using this query to get the error details but its not returning any row.
But when ran the query without "between and" i am getting the output of 30 Nov and 01 Dec records
Pls correct where i went wrong
Thanks & Regards
Srikkanth.M

1) You have a data model error. Dates really really ought to be stored as a DATE or a TIMESTAMP. Storing date data as a VARCHAR2 is going to cause a whole raft of problems down the line.
2) If ReportingDateTime is a VARCHAR2, it makes no sense to use TO_CHAR. It's already a string, no good can come from trying to convert it to a string. And you can introduce lots of fun bugs because the TO_CHAR call forces the string to be converted to a date using the session's NLS_DATE_FORMAT and then that date is converted back to a string. If the NLS_DATE_FORMAT for the session happens not to match the hard coded date format, you'll suddenly start getting errors.
3) Your example works because '29-NOV' comes before '30-DEC' alphabetically. But you would also return data for '29-Oct' and '29-Sept' which is almost certainly not what you want.
4) Until you correct the data model issue, you want
WHERE to_date( ReportingDateTime, 'DD-MON-YYYY HH24:MI:SS' )
  BETWEEN to_date( '29-NOV-2010 06:00:00', 'DD-MON-YYYY HH24:MI:SS' )
      AND to_date( '30-DEC-2010 05:59:59', 'DD-MON-YYYY HH24:MI:SS' )5) If you are going to make the mistake of storing date date as a character string, it would make sense to at least choose a format that sorts the same alphabetically and chronologically (i.e. 'YYYYMMDDHH24MISS'). Not that this would make #1 any less true. But it would at least reduce the possibility that someone incorrectly doing a string comparison would at least get the right results.
Justin

Similar Messages

  • Expired certificate and opera mini not working

    i had a problem while i was installing my whatsap,it always says "expired certificate" and my opera mini is not working,says check date settings.please help

    As this is your first post upon the forum an indication as to what device this appertains would be helpful.
    Happy to have helped forum in a small way with a Support Ratio = 37.0

  • How to set up the interaction between InDesign CS6 8.0 and Photoshop CS 6 - if Photoshop is installed and the 64 and 32-bit?? default InDesign refers to the 64-bit version of Photoshop and scripts do not work.

    how to set up the interaction between InDesign CS6 8.0 and Photoshop CS 6 - if Photoshop is installed and the 64 and 32-bit?? default InDesign refers to the 64-bit version of Photoshop and scripts do not work.

    Nice of you to point it out here as I at least don’t follow Mr.Nash’s blog regularly.

  • I'm trying to sync Contacts between my iMac ans my iPad 2 via iCloud and it's not working. In both devices, the option to sync Contacts is seleted. What is happening and how to sync these data?

    I'm trying to sync Contacts between my iMac ans my iPad 2 via iCloud and it's not working. In both devices, the option to sync Contacts is seleted. What is happening and how to sync these data?

    This is the ipod touch forum

  • ITunes sharing between Mac and PC is not working

    iTunes sharing between Mac and PC is not working. No shared music appears.
    PC = Win XP SP3; 192.168.1.101
    iTunes for Windows 6.0.4.2
    Sharing enabled / Look for shared music enabled / Share entire library
    Open and running on PC
    Windows firewall has exceptions set to allow traffic on TCP 3689, UDP 5353
    MAC = OS X 10.4.6; 192.168.1.100
    iTunes for OS X 6.0.4(3)
    Sharing enabled / Look for shared music enabled / Share entire library
    Open and running on Mac
    System Preferences | Sharing | Services
    Personal file sharing - ON
    Windows file sharing - ON
    Printer sharing - ON
    System Preferences | Sharing | Firewall
    Personal file sharing - ON
    Windows file sharing - ON
    Printer sharing - ON
    iTunes Music Sharing - ON (i.e., TCP 3689 open)
    iPhoto Bonjour Sharing - ON
    Network Time - ON
    ROUTER = Linksys BEFSR41v4; Firmware 1.04.01; 192.168.1.1
    Functioning as DHCP server
    File sharing between Mac & PC works OK
    BUT iTUNES MUSIC SHARING DOES NOT WORK IN EITHER DIRECTION
    Shared music is not visible
    Tried turning both firewalls OFF -- still nothing
    Tried installing Bonjour for Windows -- still nothing
    ANY suggestions? Please help. Thanks.
    1.8 GHz PowerPC G5   Mac OS X (10.4.6)  

    Hi cbafiero,
    It seems that the problem lies in your router. I'm not sure exactly what the issue is (I've just now discovered it myself), but after switching from a Linksys WRT54GX2 to a thrift store Netgear, my shared libraries appeared instantly. My gut is telling me that the Linksys routers are blocking the multicast traffic, which is stupid on Linksys's part, to filter traffic internally. I'll look more into the Netgear and see what it has that the Linksys doesn't (or vice versa).

  • Delete operation is not working to delete selected row from ADF table

    Hi All,
    We are working on jdev 11.1.1.5.3. We have one ADF table as shown below. My requirement is to delete a selected row from table, but it is deleting the first row only.
    <af:table value="#{bindings.EventCalendarVO.collectionModel}" var="row"
    rows="#{bindings.EventCalendarVO.rangeSize}"
    emptyText="#{bindings.EventCalendarVO.viewable ? applcoreBundle.TABLE_EMPTY_TEXT_NO_ROWS_YET : applcoreBundle.TABLE_EMPTY_TEXT_ACCESS_DENIED}"
    fetchSize="#{bindings.EventCalendarVO.rangeSize}"
    rowBandingInterval="0"
    selectedRowKeys="#{bindings.EventCalendarVO.collectionModel.selectedRow}"
    selectionListener="#{bindings.EventCalendarVO.collectionModel.makeCurrent}"
    rowSelection="single" id="t2" partialTriggers="::ctb1 ::ctb3"
    >
    To perform delete operation i have one delete button.
    <af:commandToolbarButton
    text="Delete"
    disabled="#{!bindings.Delete.enabled}"
    id="ctb3" accessKey="d"
    actionListener="#{AddNewEventBean. *deleteCurrentRow* }"/>
    As normal delete operation is not working i am using programatic approach from bean method. This approach works with jdev 11.1.1.5.0 but fails on ver 11.1.1.5.3
    public void deleteCurrentRow (ActionEvent actionEvent) *{*               DCBindingContainer bindings =
    (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    DCIteratorBinding dcItteratorBindings =
    bindings.findIteratorBinding("EventCalendarVOIterator");
    // Get an object representing the table and what may be selected within it
    ViewObject eventCalVO = dcItteratorBindings.getViewObject();
    // Remove selected row
    eventCalVO.removeCurrentRow();
    it is removing first row from table still. Main problem is not giving the selected row as current row. Any one point out where is the mistake?
    We have tried the below code as well in deleteCurrentRow() method
    RowKeySet rowKeySet = (RowKeySet)this.getT1().getSelectedRowKeys();
    CollectionModel cm = (CollectionModel)this.getT1().ggetValue();
    for (Object facesTreeRowKey : rowKeySet) {
    cm.setRowKey(facesTreeRowKey);
    JUCtrlHierNodeBinding rowData = (JUCtrlHierNodeBinding)cm.getRowData();
    rowData.getRow().remove();
    The same behavior still.
    Thanks in advance.
    Rechin
    Edited by: 900997 on Mar 7, 2012 3:56 AM
    Edited by: 900997 on Mar 7, 2012 4:01 AM
    Edited by: 900997 on Mar 7, 2012 4:03 AM

    JDev 11.1.1.5.3 sounds like you are using oracle apps as this not a normal jdev version.
    as it works in 11.1.1.5.0 you probably hit a bug which you should file with support.oracle.com...
    Somehow you get the first row instead of the current row (i guess). You should debug your code and make sure you get the current selected row in your bean code and not the first row.
    This might be a problem with the bean scope too. Do you have the button (or table) inside a region? Wich scope does the bean have?
    Anyway you can try to remove the iterator row you get
    public void deleteCurrentRow (ActionEvent actionEvent) { DCBindingContainer bindings =
    (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    DCIteratorBinding dcItteratorBindings =
    bindings.findIteratorBinding("EventCalendarVOIterator");
    dcItteratorBindings.removeCurrentRow();Timo

  • I have installed adobe flash player on my computer and this is not working please help

    I have installed adobe flash player on my computer and this is not working please help

    What is your operating system & version?
    What is your web browser?
    What means "not working"; what do you see instead of the expected Flash content?

  • Java7 and Java6 will not work opening pogo games on firefox, but works perfectly for IE, what can I do to fix this issue?

    Java will not work on the computer all of a sudden. Now when I go to open a Pogo game room up i get a Mozilla red lego piece in the corner saying "Some plug ins have been De-activated for your safety, in the box will be "Java (TM) platform SE 6 U". I have removed Java7 and reloaded it, after that not working found Java6 and loaded and reloaded it and it is not working.
    Now after 3 minutes of the room not loading Pogo will give me the error message of
    Java Not Found or Not Working
    Explanation:
    This error means Java (one of the technologies built into most browsers) is not working correctly on your browser.
    You must have Java installed on your computer in order to run Pogo games, and it must be functioning properly. Either you don't have Java installed yet, or the Web browser you're currently using doesn't support Java or you have Java (or Javascript) disabled in your browser.
    How to Fix the Problem:
    Java is a free download that is required to play Pogo games. Not all computers come with Java pre-installed.
    If you haven't played Pogo games before and are getting this error, you probably just need to install Java on your computer.
    For instructions on installing Java for your operating system and browser click here.
    If you believe Java might be installed but disabled for your browser, please be sure to enable the plugin for your browser. If you need help, click here.
    If you already have Java installed and it is not disabled, your Java may be out-of-date or no longer working. In that case, your Java might need to be upgraded or reinstalled. If you need help, click here.
    I have done the click here in last sentence and all it wants me to do is download Java7 which was the first reason it was not working.
    Hopefully I have explained this well enough, from Mozilla this is what I get BUT if I go to Internet Explorer (which I HATE) the Java6 and Java7 work perfectly fine. So apparently the Java is downloaded correctly I just can not get it to play nicely with Mozilla and that is my main goal.
    EA games help page has gone through it all with me and have proven over and over (after 1 hour sessions, 45 waits for them) Java is working on my computer perfectly with IE just not on Firefox and with the rural situation I have become dependent on Mozilla because of the no fiber optics here it has been my best and only source of successfully using the internet here in the far out part of the country.

    Thank you so much, for once in my computer life I knew what the problem was, what caused it, why it was caused, what it did, what it made it do and most importantly how to fix it and to do it correctly and expeditiously. I can not Thank You all enough for all of the help! I also have Pogo mailed this to all on my friends list, where they have all learned as I have and have fixed theirs also. and the message is being spread. Thank You again, I just can not say it enough.

  • I am using laptop hitting and slow system not working

    i am using laptop hitting and slow system not working and very late opan file browser every think . plez help me

    Hi,
    Shut down the notebook.  Tap away at the esc key as you start the notebook to enter the Start-up Menu.  Select the Bios option ( usually f10 ) and under the Advanced or Diagnostic tab you should find the facility to run tests on both the Hard Drive and Memory.  Post back with the details of any error messages.
    Note:  If the option to run these tests is not available in the Bios Menu, use the f2 diagnostic menu instead.
    Can you also post back with the following details.
    1.  The full Model No. and Product No. of your notebook - see Here for a guide on locating this information.
    2.  The full version of the operating system you are using ( ie Windows 7 64bit ).
    Regards,
    DP-K
    ****Click the White thumb to say thanks****
    ****Please mark Accept As Solution if it solves your problem****
    ****I don't work for HP****
    Microsoft MVP - Windows Experience

  • LIKE operator is not working in SQL Query in XML file

    Hi Gurus,
    LIKE operator is not working in SQL query in XML template.
    I am creating a PDF report in ADF using Jdeveloper10g. The XML template is as follows
    <?xml version="1.0" encoding="WINDOWS-1252" ?>
    <dataTemplate name="catalogDataTemplate" description="Magazine
    Catalog" defaultPackage="" Version="1.0">
    <parameters>
    <parameter name="id" dataType="number" />
    <parameter name="ename" dataType="character" />
    </parameters>
    <dataQuery>
    <sqlStatement name="Q1">
    <![CDATA[
       SELECT ename, empno, job, mgr from EMP where deptno=:id and ename LIKE :ename || '%']]>
    </sqlStatement>
    </dataQuery>
    <dataStructure>
    <group name="EmployeeInfo" source="Q1">
    <element name="EmployeeName" value="ename" />
    <element name="EMPNO" value="empno" />
    <element name="JOB" value="job"/>
    <element name="MANAGER" value="mgr" />
    </group>
    </dataStructure>
    </dataTemplate>
    if i pass the parameter value of :ename from UI, it doesn't filter. But if I give ename = :ename it retrieves the data. Can anyone help me why LIKE operator doesn't work here?
    Appreciate your help,
    Shyamal
    email: [email protected]

    Hi
    Well for a start, you are doing some very strange conversions there. For example...
    and to_char(a.msd, 'MM/DD/YYYY') != '11/11/2030'
    and to_char(a.msd, 'MM/DD/YYYY') != '10/10/2030'If a.msd is a date then you should e converting on the other side ie.
    and a.msd != TO_DATE('11/11/2030', 'MM/DD/YYYY')
    and a.msd != TO_DATE('10/10/2030', 'MM/DD/YYYY')Also, you may want to take into consideration nothing being input in :P2_ITEM_NUMBER like this...
    AND INSTR(a.item_number,NVL(:P2_ITEM_NUMBER,a.item_number)) > 0Is item number actually a number or char field? If it's a number, you want to explicitly convert it to a string for using INSTR like this...
    AND INSTR(TO_CHAR(a.item_number),NVL(TO_CHAR(:P2_ITEM_NUMBER),TO_CHAR(a.item_number))) > 0?
    Cheers
    Ben

  • My sounds and audio is not working. it's not in mute. help please

    i need help. my sounds and audio is not working. but it's not in mute button.

    Hi,
    Can you post back with the following details.
    1.  The full Model No. and Product No. of your notebook - see Here for a guide on locating this information.
    2.  The full version of the operating system you are using ( ie Windows 7 64bit ).
    Regards,
    DP-K
    ****Click the White thumb to say thanks****
    ****Please mark Accept As Solution if it solves your problem****
    ****I don't work for HP****
    Microsoft MVP - Windows Experience

  • Command-delete, command-left and command-right not working as expected

    On a Mac (in my case OS X 10.6.8) when entering text into a text-field or text-box 'command-delete' in any other application deletes everything between the cursor and the beginning of the current line. I'm using Firefox 10.0.1 and this does not work.
    Also, in certain rich text editors such as Gmail's compose mail text-box 'command-left' and 'command-right' which would usually jump to the respective beginning or end of the current line doesn't seem to work.

    Try:
    Create Table ImportLog
    ( recid int,
    grouploadid int,
    groupid int,
    tablename varchar(128),
    note varchar(500)
    Insert Into ImportLog
    Values
    (1,216,1,'tableb','noteb'),
    (2,217,1,'tablea','notea'),
    (3,217,2,'tableb','noteb'),
    (4,217,1,'tablea','notea'),
    (5,230,1,'tableb','noteb'),
    (6,244,1,'tablea','notea'),
    (7,244,2,'tableb','noteb'),
    (8,244,3,'tablec','notec'),
    (9,217,3,'tabled','noted')
    select r1.RecID, r1.GroupLoadID, r1.groupid, r1.tablename, r1.note,
    r2.RecID, r2.GroupLoadID, r2.groupid, r2.tablename, r2.note
    from ImportLog r1
    full join
    (select RecID, GroupLoadID, groupid, tablename, note
    from ImportLog
    where GroupLoadID = '217'
    ) r2
    on r1.TableName = r2.TableName and r1.Note = r2.Note and r1.Groupid = r2.Groupid
    where r1.GroupLoadID = '244'
    order by 1
    GO
    DROP Table ImportLog
    GO
    RecID GroupLoadID groupid tablename note RecID GroupLoadID groupid tablename note
    6 244 1 tablea notea 2 217 1 tablea notea
    6 244 1 tablea notea 4 217 1 tablea notea
    7 244 2 tableb noteb 3 217 2 tableb noteb
    8 244 3 tablec notec NULL NULL NULL NULL NULL
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Database Design
    New Book / Kindle: Beginner Database Design & SQL Programming Using Microsoft SQL Server 2014

  • I had somebody  work on my OS 10.9.2 to speed it up. He failed and now  Preview, Textedit, App Store, Mail and Contacts  do not work anymore. I can still use Safari, Firefox and iPhoto etc. How do I get it fix I can still use Safari, Firefox and ed again?

    I had somebody  work on my OS 10.9.2 to speed it up. He failed and now  Preview, Textedit, App Store, Mail (crashes) and Contacts  do not work anymore. I can still use Safari, Firefox, Word, Photoshop and iPhoto etc. How do I get the Apple programs fixed again?

    Try these in order testing your system after each to see if it's back to normal:
    1. a. Resetting your Mac's PRAM and NVRAM
        b. Intel-based Macs: Resetting the System Management Controller (SMC)
    2. Restart the computer in Safe Mode, then restart again, normally. If this doesn't help, then:
         Boot to the Recovery HD: Restart the computer and after the chime press and hold down the
         COMMAND and R keys until the Utilities menu screen appears. Alternatively, restart the
         computer and after the chime press and hold down the OPTION key until the boot manager
         screen appears. Select the Recovery HD and click on the downward pointing arrow button.
    3. Repair the Hard Drive and Permissions: Upon startup select Disk Utility from the Utilities menu. Repair the Hard Drive and Permissions as follows.
    When the recovery menu appears select Disk Utility. After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list.  In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the main menu. Select Restart from the Apple menu.
         Reinstall the 10.9.2 update: OS X Mavericks 10.9.2 Update (Combo).
    4. Reinstall Lion/Mountain Lion, Mavericks: Reboot from the Recovery HD. Select Reinstall Lion/Mountain Lion, Mavericks from the Utilities menu, and click on the Continue button.
    Note: You will need an active Internet connection. I suggest using Ethernet if possible because it is three times faster than wireless.
    Reinstall the 10.9.2 update: OS X Mavericks 10.9.2 Update (Combo).

  • PSE13 trial version and it will not work with Windows 7

    I have downloaded PSE13 trial version and it will not work with Windows 7

    I have been using PSE 13 for 3 months with no problems.   When I launch the Editor in PSE 13 this is what I get -
    "Adobe Photoshop cannot run on this computer because this version of Photoshop requires Windows 7 or later"
    RAM 12.0GB
    64 bit operating system
    Intel(R) Core(TM)I7CPU 920 @ 2.67GHz
    Windows 7 SP1
    Hope this helps.
    Lynne

  • I am trying to download Illustrator CC and it is not working. It is sort of stuck on the page "Illustrator is downloading". Any advice?

    I am trying to download Illustrator CC and it is not working. It is sort of stuck on the page "Illustrator is downloading". Any advice?

    Lena,
    Have you downloaded the Application Manager?
    You may try to restart the Creative Cloud application by quitting and relaunching it.
    Or this may be one for this specialized forum (where you may be able find the answer from previous threads),
    http://forums.adobe.com/community/download_install_setup
    or for a chat,
    Creative Cloud support (all Creative Cloud customer service issues, chat open between 5AM and 7PM PST/PDT on workdays)
    http://helpx.adobe.com/x-productkb/global/service-ccm.html
    or for Adobe phone Support,
    http://helpx.adobe.com/adobe-connect/adobe-connect-phone-numbers.html

Maybe you are looking for

  • Resizing Windows Partition - No Longer Booting

    Whenever I attempt to setup a Windows/Linux Dual boot I get hit with this same dilemma. I start off with a NTFS format partition with Windows XP on it. As soon as I resize the partition, it no longer boots. Even before installing linux/grub. I defrag

  • Importing from iPhone 4 to new Macbook Pro iTunes?

    Have an almost full iPhone 4 and have just ordered a new Macbook Pro How do i import my phone songs, and apps and basically my itunes to my new Macbook Pro? Or do i have to log into my itunes account and re-burn my CD"s back into the computer to put

  • Integration with JMS queue from BizTalk 2013R2

    Hi All, We are planning to integrate biztalk application with Oracle Siebel CRM (8.1.1.11). they wanted to use JMS queue to receive xml message from BizTalk2013R2 and also send message to BizTalk for more reliability. IS there any out of box adapter

  • Deleting Duplicate Photos in LR5

    How do I delete duplicate photos?  I have hundreds of duplicates in the catelog, folders and collections.  I must have imported them without checking "Do not import suspected duplicates".  Now what?  Thanks.

  • IPhone 4 to iMovie to ATV2 Export options

    What is the best way to export a movie shot on iphone4 edited in iMovie 11 and exported to ATV2?  I see the share feature but it does not seem to have HD which I though iPhone 4 did?? Help please. Thanks