Problem with query between Dates:

Hello again,

The following query gives some problems in that the line where 'CURRENT_DATE' is between 'START_DATE' and ' end_date.
The query returns the records close to these dates, but some missing on the end_date. I was wondering if there is 'of time to play here? How is that only the date component used for research?

Select * from)
SELECT TO_CHAR (LEAVE. Start_date, 'DD-MON-YY') AS Start_Date,
TO_CHAR (LEAVE. End_date, 'DD-MON-YY') AS end_date,.
TO_CHAR (CURRENT_DATE, 'DD-MON-YY') SUCH AS CURRENT_DATE,
LEAVE.NAME as the NAME,
LEAVE.ID as ID,
LEAVE. DAY by day,
LEAVE. SUPERVISOR supervisor,
LEAVE. LEAVE_TYPE,

"LEAVE".

WHERE CURRENT_DATE BETWEEN start_date AND end_date
)


Kind regards

Steve Welch

Try this:

WHERE the trunc (CURRENT_DATE) BETWEEN trunc (start_date) AND trunc (end_date)

Tags: Database

Similar Questions

  • Problem with "Query" parameter data pump

    Hello guys,.

    My information in the table are less than
    Name of the schema: CT_COM
    Table name: order_session
    The current size of the table = ~ 75
    Total number of rows in the table: 3847904-> select count (*) from CT_COM.order_session;
    Total number of lines with condition: 734042 (orders over 1 January 08)-> select count (*) from CT_COM.order_session where updated_date < = 31 December 07 ';


    Now, I'm taking an export in which I want to capture all the orders that are placed before 1 January 08. Here's the query I use on a DB of RHEL server. I 10.2.0.3 db on this server.

    expdp "" / as sysdba "" logfile = FULL_TABLE:order_session_upto_dec_31_07.log query = CT_COM.order_session dumpfile=FULL_TABLE:order_session_upto_dec_31_07_%U.dmp:------"" where updated_date------<------= \'31-DEC-07\'\ ' filesize = 2 G job_name = order_session_upto_dec_31_07 "

    Export: Release 10.2.0.3.0 - Production on Wednesday, August 4, 2010 16:11

    Copyright (c) 2003, 2005, Oracle. All rights reserved.

    Connected to: Oracle Database 10g Release 10.2.0.3.0 - Production
    Departure 'SYS '. "' ORDER_SESSION_UPTO_DEC_31_07 ': ' / * AS SYSDBA' dumpfile=FULL_TABLE:order_session_upto_dec_31_07_%U.dmp logfile = FULL_TABLE:order_session_upto_dec_31_07.log query = CT_COM.order_session:" "where updated_date < = 31 December 07 ' ' filesize = 2 G job_name = order_session_upto_dec_31_07"
    Current estimation using BLOCKS method...
    Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
    Total estimation using BLOCKS method: 0 KB
    Processing object type SCHEMA_EXPORT/ROLE_GRANT
    Table main 'SYS '. "' ORDER_SESSION_UPTO_DEC_31_07 ' properly load/unloaded
    ******************************************************************************
    Empty the files together for SYS. ORDER_SESSION_UPTO_DEC_31_07 is:
    /Backup/export/tables/order_session_upto_dec_31_07_01.dmp
    Job 'SYS '. "" ORDER_SESSION_UPTO_DEC_31_07 "carried out at 16:11:31

    Query runs fine without error. However if you look at the output above it exports all lines. I keep seeing Total estimation using BLOCKS method: 0 KB. -What did I do wrong?

    I even tried the same scenerio with table scott.emp and I see the same behavior. Did I miss something in my where clause or is this a bug?

    Expdp $ Linux-223: (bonus) "" / as sysdba "" dumpfile=full_table:a%U.dmp logfile = FULL_TABLE:a.log query = scott.emp:------"' where sal------> 2000------' filesize = 2 G job_name = b.job"

    Export: Release 10.2.0.4.0 - Production on Wednesday, August 4, 2010 15:11:31

    Copyright (c) 2003, 2007, Oracle. All rights reserved.

    Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
    With partitioning, OLAP, Data Mining and Real Application Testing options
    Departure 'SYS '. "' B ': ' / * AS SYSDBA' dumpfile=full_table:a%U.dmp logfile = FULL_TABLE:a.log query = scott.emp:" where sal > 2000 "filesize = 2 G job_name = b.job
    Current estimation using BLOCKS method...
    Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
    Total estimation using BLOCKS method: 0 KB
    Processing object type SCHEMA_EXPORT/ROLE_GRANT
    Table main 'SYS '. "' B ' properly load/unloaded
    ******************************************************************************
    Empty the files together for SYS. B is:
    /tmp/A01.dmp
    Job 'SYS '. "' B ' managed to 15:12:46


    Any help will be appreciated.


    -MM

    Published by: UserMM on August 4, 2010 14:48

    It has nothing to do with your request, it has to do with the rest of your order expdp. You specify a schema on the table, or you specified an export scheme so default datapump is the schema to run the task. As you export the work as "sys" it will only export objects belonged to sys. Since datapump does not export the sys objects, nothing get exported. You want to add

    schemas = CT_COM

    or

    tables = CT_COM.order_session

    Thank you

    Dean

  • Problem with the CLOB data type.

    Greetings,

    I am facing a problem with the CLOB data type. I know that the CLOB data type is 4 GB (I use Oracle 9i). But in the Pl Sql procedure, I can only store 34305 size for a CLOB variable character data.

    This is the test script that I am trying to run.

    DECLARE
    -Local variables here*.
    I have INTEGER;
    C_1 CLOB.
    BEGIN
    FOR Rec IN (SELECT
    *
    ACCORDING TO THE TABLE)
    LOOP
    C_1: = c_1 | Rec.Clo_1;
    END LOOP;
    EXCEPTION
    WHILE OTHERS THEN
    Dbms_Output.put_line (SQLERRM);
    END;


    Here variable C_1 range value 34305 good character regardless of type CLOB. Now the above script fails if query my buckle - huge number of return values. It is throwing the exception "error during transfer of files ORA-06502: PL/SQL: digital error or value."

    He would be grateful if someone can help me on this.

    Thank you.

    You are probably better off using DBMS_LOB.append, instead of the concatenation of varchar2 (|).

    And... take off your when-other Manager exceptions, please...

  • Problem with sharing of data specific to the application via BBM 10.2

    Hello - I am having a problem of data sharing applications with BBM 10.2-specific. I take the advice of some comments here, and it seems to work on 10.1. I can receive the file on 10.2, but when I try to share on the same device that I get this:

    InvocationWrapper::onQueryFinished: no matching result from Menu Service for query
       mimeType=""
       uri=QUrl("file:///accounts/1000/shared/misc/My App Data.myapp")
       data= ""
       metadata= QMap()
       perimeter= 0
       action= "bb.action.SHARE"
       target= "sys.bbm.sharehandler"
       invokerIncluded= false
    InvocationPrivate::onQueryResolved: no result matching query, no armed signal sent.
    

    It is the call that I use, which works on 10.1 but not 10.2:

    Invocation {
       id: invokeBBM
       query {
          InvokeQuery {
             id: invokeBBMQuery
             uri: "file:///accounts/1000/shared/misc/My App Data.myapp"
             invokeTargetId: "sys.bbm.sharehandler"
             invokeActionId: "bb.action.SHARE"
          }
       }
    }
    

    I also tried it with a "text/plain" MIME type and a few other variations, same result. If something has changed in point 10.2?

    (And while I'm asking, any reason why I can't use the data instead of a file uri? I need to convert the data in JSON, save the file, share the file, send, receive, save the file on the receiver, then open it, read it, and convert it back. Seems a little roundabout, if I could share the JSON data. "(And this is the only reason that my application requires permissions of shared files)."

    Thank you!

    It is a problem with the current version of BlackBerry Dev 10.2 Alpha.  You can call C++ BBM, but citing QML does not work.

  • problem with query select in the search

    Hello

    Here I use MYSQL database and when I insertind to the database date, it saves as "2009-11-10 00:00:00 ' and when I used to do this show in dateformat as November 10, 2009".

    Here's the problem occurs, when I write a search like query

    Select recruitername, interviewdate, skillset
    details
    where interviewdate = #form.interviewdate #.

    I'm not a problem with the date. could u please help me how to solve this problem.

    Or, better yet, a with a type date.

    WHERE interviewdate =

  • Problems with registration of data in a FPGA project.

    I have problems trying to save data that I receive on my CompactRIO. I can get the data off of it, trace and display, but I can't seem to save to a file with a recording of VI. Try to solve this problem, I did a VI outside our project that runs the simple task of saving a table provided in a .csv file. Outside the project, this works fine, but when I add this VI project is when I get problems. If I provide a path outside the project, he invites me to the path, in the project, this guest never appears, but I get an error indicating that the user has canceled the operation. I found that this error is the same as you would get if you closed the guest to use the X rather than hitting the Cancel button. If I provide a path in VI, I get no error, but nothing happens and nothing is recorded. Another interesting thing happens when I move this file to the project. When I go to run it, I get a prompt asking you to save Message String.vi Format because it has unsaved changes, and when I ask him to list the unsaved changes, he said that the VI has been recompiled. When I take the VI on the project and run it, it says he has recompiled again and must still be saved. It's really frustrating when such a simple task will not work for any help that you could give is appreciated.

    Will be

    He will never be able to save the file on your PC, only on the controller it self.

    Then use FTP to transfer the files to your PC.

    Or you could do a host PC VI that gets the data from the controller, and then stores the data on the PC.

    To transfer the data, you can use TCP or shared variables.

  • problem with the backup data in text file

    Hello

    The problem I am facing wihile, saving the data in the text file is that everytime when I'm slecting the path of the façade, data that are recorded are added with the previous data, not only in the new text, the new data set is saved but also, is there any previuos run for the program , the corresponding data is also present in this text file.

    However, when I change the same ''(file path) to 'constant' in the control block diagram, and then add the path of the file, it doesn't have this problem. Basically, changing the "file path" constant in the diagram of control block (so that it is displayed in the front panel) is at the origin of the problem.

    Help, please!

    Thank you

    Your shift on the loop Register For is not initialized. It will keep the value of the string since the last time that he performed. That initialize and it should solve your problem.

  • Problem with registration of data in the txt file

    Hello

    I have 2009 Labview, Labview real-time 2009 and cRIO 3.3.0. I also NEITHER cRIO-9024 more cRIO-9112 chassis and modules.

    I would like to save the data measured modules in the txt files, but I want to do in a period of time to time desire. For example, I want to save data of measurements of 60 seconds and repeat every one hour. I of the project (in the file attachment vi) and normally it works fine but I noticed that the recording of the data is not correct. I mean it seams to save what was in the memory before. That's the problem with Windows XP I have check with another computer with Vista and it seems to be ok. It seems that on XP the buffer (refnum?)  is not clear and it retains the previous values.

    Can someone explain to me why it happened and how I can obey Windows XP? Or maybe there are techniques to clear the memory buffer/refnum for rescue?

    Thanks for any help.

    Kind regards

    Kamil


  • BlackBerry Q5 big problem with BB Q5 data - IP ADDRESS REJECTED. :( :(

    Hi all!! I have a blackberry Q5, the version of the 10.2.1.2102 software... It is the best blackberry smartphone I've ever had! but since one week, I have a very big problem with my BB Q5: if I want to surf the internet, with data from my phone (not in WIFI mode but with the data of the phone (4G, 3 g +)), I can not go on any website, but the only thing I watch is a white screen with this message "ERROR HTTP 403.6 ": the IP address of the client has been rejected"...! What can I do? I'm really desperate! I called my provider (SFR), they told me that my connection is ok, I'm not a problem with them, and this is my phone... HELP ME PLEASE!  

    Hello!!! Just to say that finally, after several attempts, I have solved my problem: there was a problem with my service provider SFR with my phone! I regret bringing this up on the forum, but when you call the customer service you think they know their work... but fortunately for us if we have the blackberry is because we are not so ignorant on the connections, network and telephone line! : D have a nice day blackberry users!   

  • Problem with order submit data record for Reporting ATG

    Hi, r. j. Nunes

    I am facing problems with the connection to present newspapers for ATG of the report. The logs for RegistrationFileLogger, SiteVisitFileLogger, UserFileLogger, SegmentFileLogger were successfully getting generated but unable to see the logs for OrderFileLogger during shipment of the order.

    I understand that the/atg/reporting/datacollection/trade/SubmitOrderEventListener of the listener must be notified so that the listeners of corresponding data is called in the order:

    SubmitOrderEventListener-> OrderLogEntryQueueSink-> OrderLogEntryGenerator-> OrderFileLogger

    and newspapers would be written.

    But I'm not able to determine which component notifies the SubmitOrderEventListener by submitting an order.


    Is - this SendFulfillmentMessage component? But SendFulfillmentMessage sends the message to the localdms topic: / local/realization/LocalSubmitOrder on the port of OrderSubmitPort which as component SubmitOrderEventListener listen the subject localdms: / local/realization/LocalSubmitOrder on the DEFAULT port?


    Could someone please clarify.

    Thank you

    Saud

    Hello

    Pipelinelink = "sendFulfillmentMessage" name has been commented to our commercepipeline.xml that we did not use OOTB Presse. Once I removed the comment, sent messages and newspapers to submit order got generated.

    Thank you

    Saud

  • Problem with a field date

    Hello


    I have a pl/sql page, which is the result of a statement select under certain conditions.

    One of the conditions is like:

    AND between MyColumn (: P1_MyDateItem - 7,: P1_MyDateItem)

    but as soon as I include an addition or a subtraction (: P1_datefield - 7), I get ORA-06550: line 18, column 28: PL/SQL: ORA-00932: inconsistent data types: expected DATE got the NUMBER

    How can I solve this error?


    In addition,
    I'm moving the date field to a second page in a hidden field. In a similar scenario as described above, how can I manipulate the date by using the hidden field. That is to say. in my tests, I think that it converts a little the 'date' to 'char 'format? '. can I also make the same 'Date-7' manipulation but this time using a hidden field to the place?

    Thank you

    FabioBui wrote:
    but as soon as I include an addition or a subtraction (: P1_datefield - 7), I get ORA-06550: line 18, column 28: PL/SQL: ORA-00932: inconsistent data types: expected DATE got the NUMBER

    How can I solve this error?

    Try to convert it first to a date

    to_date(:P1_datefield, )-7
    

    I'm moving the date field to a second page in a hidden field. In a similar scenario as described above, how can I manipulate the date by using the hidden field. That is to say. in my tests, I think that it converts a little the 'date' to 'char 'format? '. can I also make the same 'Date-7' manipulation but this time using a hidden field to the place?

    Yes, if that's what you want to do. A date field is just a text area, made more pleasant with the jQuery date picker.

    If date picker:

    on an item hidden

    only difference being the type of display.

    Don't forget to convert a date in your pl/sql code.

  • Problem with query issuing service

    Hello

    I had a problem with sub query with the cast function.
    SQL>  SELECT
      2    CAST ( ( ( (COUNT (
      3    CASE
      4      WHEN ServiceRequest_ec.WasCaseClosed = 1
      5      THEN 1
      6    END) )* 100) / (COUNT (DISTINCT ServiceRequest_ec.case_id)) ) AS nvarchar) AS Average
      7     FROM ServiceRequest_ec
      8  INNER JOIN cases_ec
      9       ON ServiceRequest_ec.case_id = cases_ec.case_id
     10  INNER JOIN contacts_ec
     11       ON ServiceRequest_ec.contact_id = contacts_ec.contact_id
     12  INNER JOIN users_ec
     13       ON contacts_ec.user_id = users_ec.user_id
     14  INNER JOIN departments_ec
     15       ON contacts_ec.department_id = departments_ec.department_id
     16    WHERE 1                         = 1;
      END) )* 100) / (COUNT (DISTINCT ServiceRequest_ec.case_id)) ) AS nvarchar) AS Average
                                                                       *
    ERROR at line 6:
    ORA-00902: invalid datatype 
    
    
    SQL> spool off
    Any help appreciated reallly.

    Thanks in advance

    Published by: user512743 on December 8, 2008 03:40

    I find a lot of difference in your script. Just run this part and let us know if it is running or not->

    SELECT  CAST(
                 (
                  COUNT(
                         CASE
                           WHEN ServiceRequest_ec.WasCaseClosed = 1 THEN
                             1
                         END
                       ) * 100
                  )/(
                      COUNT(
                             DISTINCT ServiceRequest_ec.case_id
                           )
                    ) AS nvarchar2(30)
                 ) AS Average
    FROM ServiceRequest_ec
         INNER JOIN cases_ec
            ON ServiceRequest_ec.case_id = cases_ec.case_id
         INNER JOIN contacts_ec
            ON ServiceRequest_ec.contact_id = contacts_ec.contact_id
         INNER JOIN users_ec
            ON contacts_ec.user_id = users_ec.user_id
         INNER JOIN departments_ec
            ON contacts_ec.department_id = departments_ec.department_id
    WHERE 1 = 1
    GROUP BY contacts_ec.user_id,
             users_ec.UserName         ,
             users_ec.firstname        ,
             users_ec.lastname         ,
             contacts_ec.department_id ,
             departments_ec.name;
    

    Maybe you run a partial query of much more complex query. And does not separate the two successfully. After you receive this error - I guess.

    Just run my solution and let us know.

    Kind regards.

    LOULOU.

  • Problems with etherchannel between 2970 and 3500xl

    3500xl:

    WC10 version 12.0 (5)

    2970:

    Version 12.1 (11) AX

    I have four ports physical configuration in Group 1.

    2970 CONFIG:

    interface GigabitEthernet0/21-24

    switchport mode access

    no ip address

    full duplex

    Speed 100

    channel-group mode 1 on

    3500XL CONFIG:

    interface FastEthernet0/45-48

    full duplex

    Speed 100

    Port 1 group

    SUMMARY ETHERCHANNEL 2970

    SH etherchannel summary

    Flags: D - low P - port-channel

    I have - autonomous s - suspended

    R - Layer 3 S - Layer2

    u - unfit to tied selling

    U - channel port in use

    Ports of Port-Channel Group

    -----+------------+-----------------------------------------------------------

    1 Po1 (SU) Gi0/21 (P) Gi0/22 (P) Gi0/23 (P) Gi0/24 (P)

    ETHERCHANNEL SUMMARY FOR 3500XL

    Flags: d - D - down failure

    I - in use

    Port group

    ----- -----

    1 Fa0/46 (D) Fa0/45 (Dd) Fa0/48 (D) Fa0/47 (D)

    Everything seems to work with 2970 and data are certainly going through. I'm Telnet via connection and servers are connected.

    3500xl watch interfaces are in decline and spanning tree protocols in State of block. I know the etherchannel works but the 3500 says that everything is down. Any help would be appreciated.

    Thank you

    Brett

    Hello

    That you have connected only 1 port so have u deleted the config port-port group on 3500xl 48. If you have so and yet shpwing down, then I tell stop you doen the port manually and do not close.

    also try to change the 350xl ports.

    Thank you

    Michael C

  • Problems with guests calendar date

    Hello

    I am facing the issue calendar dashboard date invites you. When I try to compare this value saved in the presentation variable on the criteria tab, then the following error has occurred:

    [nQSError: 46046] 06/05/2009 DateTime value does not match the specified format.



    I read in this blog ( http://108obiee.blogspot.com/2009/05/how-to-add-leading-zeros-after.html ) that we have to make some changes in the calender.js which is present in the location \OracleBI\oc4j_bi\j2ee\home\applications\analytics\analytics\res\b_mozilla and no location \OracleBI\web\app\res\b_mozilla.

    Right now I use Oracle Application server instead of the server oc4j standalone that's why I have not \OracleBI\oc4j_bi folder in my list.

    Can you get it someone please let me know where can I do the change in calender.js

    Kind regards

    We must not mix the format of a date and the date type.
    In a filter to a formula, the goal is not to give a format, but a variable with a type date.

    The variable presentation take the data type of the physical column corresponds to the column of presentation.
    Can you give a check. Here's a how-to:
    http://gerardnico.com/wiki/dat/OBIEE/presentation_service/obiee_date_variable#understanding_the_datatype_of_a_presentation_variable
    If you have a text, you must change it as a date.

    Thanks, I see that there is error OBIEE. Can you give us the OBIEE interpreted as logical SQL

    -------------------- SQL Request:
    SET VARIABLE QUERY_SRC_CD='Report',SAW_DASHBOARD='/users/administrator/_Portal',SAW_DASHBOARD_PG='Date',SAW_SRC_PATH='/users/administrator/DateAnswer',DISABLE_CACHE_HIT=1; SELECT Calendar."Time Id" saw_0, cast(Cal.........
    

    You can find it in the newspaper.

  • Need help with query between 2 dates

    Hello

    I did not SEE in a long time and need help with a simple query.

    I have a table of DB access with 3 fields, name, date and number

    What I want is to create a query to retrieve all the names between 2 dates

    When I ask the date field, the results are showing in this formats 2013-07-12 00:00:00

    Here's my query

    < cfquery datasource = 'mydb' name = 'test' >

    SELECT name from myTable

    where edate between ' 2011-01-01 00:00:00 ' AND ' 2013-01-01 00:00:00 '

    < / cfquery >

    < cfoutput query = 'test' >

    #name #.

    < / cfoutput >

    What I get is this error

    ODBC = 22005 (assignment error) error code

    [Microsoft] [ODBC Microsoft Access driver] Type mismatch of data in the expression of the criteria.

    Don't know what I'm doing wrong here.

    Please let me know.

    Thank you

    SELECT ename

    FROM MyTable

    WHERE edate BETWEEN

    AND

    #ename #.

Maybe you are looking for

  • SISO OFDM TDD example does not

    I tried to use the example of SISO OFDM. But to the surprise of his does not work in both two cases: -. 1 looping on air (.) GVI gives no error, but VLC does not flow of Ant) 2 no loopback: an error is returned on the marketing of the Base station: -

  • Any type of server i/o available even after the installation of DSC

    I installed the demo of LabVIEW 2009 and DSC 2009 versions. I created a new project and then right click on my computer to create a new server I/o. I expect to see at least some types of servers available, but the list is empty. During the installati

  • How can I reduce the size of one of 'My images' print to?

    How can I reduce the size of the 'My pictures' draws what size I want (so I can print six or eight copies of the same image on a single sheet of 8.5 "x 11")?

  • FolderName Import does not not on DevAlphaC

    In my main.qml, I have two file import: import "preferences" import "logs" I can run the project successfully on the simulator of Q10, but it fails on the DevAlphaC: Critical: 15:38:27.986 bb::cascades::QmlDocument: error when loading QML from: QUrl(

  • How to change the background color of TabbedPane?

    Hi all Is there any property to change the background color of the tabbed pane, IE change the black color by default tabbedpane to any other color or background image custom like this Ant. give me a link or idea to develop. Thanks in advance. Kind re