Get date between 1st of current year and 31st Dec of current year

Hello:
I have a query where there is a check on date that has to be between 1 jan curr year and 31 dec curr year. How can I have that since the year component will be changing from year to year?

use the year component of sysdate?
ME_XE?select to_char(sysdate, 'YYYY') from dual;
TO_CHAR(SYSD
2007
1 row selected.
Elapsed: 00:00:00.12
ME_XE?select to_date('01-jan-'||to_char(sysdate, 'YYYY'), 'DD-MON-YYYY') from dual;
TO_DATE('01-JAN-'||TO_CHAR
01-JAN-2007 12 00:00
1 row selected.
Elapsed: 00:00:00.18

Similar Messages

  • To get date of second sunday in march and first sunday in november of  year

    Hi all,
    i need some java code to get date of second sunday in march and first sunday in november of  every year.
    this is very urgent
    plz help
    thanks in advance
    jhansi

    Hi,
    Check below links for UDF's.
    UDF
    http://flickr.com/photos/8764045@N06/
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/be05e290-0201-0010-e997-b6e55f9548dd
    Example 1
    http://www.flickr.com/photo_zoom.gne?id=544183191&size=o
    http://www.flickr.com/photo_zoom.gne?id=544183195&size=o
    http://www.flickr.com/photo_zoom.gne?id=544183225&size=o
    http://www.flickr.com/photo_zoom.gne?id=544183233&size=o
    Example 2
    http://www.flickr.com/photo_zoom.gne?id=545133789&size=o
    http://www.flickr.com/photo_zoom.gne?id=545133791&size=o
    http://www.flickr.com/photo_zoom.gne?id=545133801&size=o
    http://www.flickr.com/photo_zoom.gne?id=545133807&size=o
    http://www.flickr.com/photo_zoom.gne?id=545133811&size=o
    http://www.flickr.com/photo_zoom.gne?id=545138911&size=o
    http://www.flickr.com/photo_zoom.gne?id=545138913&size=o
    http://www.flickr.com/photo_zoom.gne?id=545138915&size=o
    http://www.flickr.com/photo_zoom.gne?id=545138917&size=o
    http://www.flickr.com/photo_zoom.gne?id=545138947&size=o
    http://www.flickr.com/photo_zoom.gne?id=545138951&size=o
    http://www.flickr.com/photo_zoom.gne?id=545005958&size=o
    Example 3
    http://www.flickr.com/photo_zoom.gne?id=549186611&size=o
    http://www.flickr.com/photo_zoom.gne?id=549186651&size=o
    http://java.sun.com/j2se/1.5.0/docs/api/
    /people/krishna.moorthyp/blog/2006/07/29/documentation-html-editor-in-xi
    /people/sap.user72/blog/2006/02/06/xi-mapping-tool-exports
    http://help.sap.com/saphelp_nw04/helpdata/en/43/c4cdfc334824478090739c04c4a249/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/22/e127f28b572243b4324879c6bf05a0/content.htm
    /people/stefan.grube/blog/2005/12/30/test-user-defined-functions-for-the-xi-graphical-mapping-tool-in-developer-studio
    http://help.sap.com/bp_bpmv130/Documentation/Operation/MappingXI30.pdf
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d046c490-0201-0010-84b6-9df523cbca31
    Regards,
    Phani
    Reward Points if Helpful

  • Sql Query for getting data between two dates

    Dear Sir,
    I have one problem, i have date stored in varchar datatype of (X) table in mysql as it was not supporting the date format of (dd/mm/yyyy) so know the problem is,
    When i going to get the data between the the two dates it is giving the un reliable answers such that
    when i am asking the query as data between 1st April to 31st December 2009 it is showing the data from the 2008 .
    is there any way to solve this problem,please help this is an urgent requirement, your replay will be helpful to me.
    With Regards
    Ramakrishna Y

    You either have a SQL problem and this is the incorrect place to ask.
    Or you have a Java problem in code we cannot see. When posting code use the code tags. Click the CODE button and paste your code between the tags that appear.

  • Getting data between 2 dates

    Hello,
    I want to get data between 10.Mar.2005 to 20.Mar.2005
    and between 22:00 am and 02 am(next day),.
    This means the data 11.March 2005 14:00 should not be there in the output
    It should be like 10.03.2005 22:00 to 11.03.2005 02:00 and
    11.03.2005 22:00 to 12.03.2005 02:00
    12.03.2005 22:00 to 13.03.2005 02:00
    13.03.2005 22:00 to 14.03.2005 02:00 and goes on
    How should we write this in a single query??
    Regards
    Rinosh

    to get dates where time >= 22:00 and < 02:00
    select * from t where to_char(d,'HH24') not between 2 and 21;Message was edited by:
    Laurent Schneider
    to include 02:00
    SQL> select * from t where to_char(d,'HH24:MI:SS') not between '02:00:01'  and '21:59:59';

  • How can I exchange my whole data between my mac book pro and my iMac?

    How can I exchange my whole data between my mac book pro and my iMac?

    i use both, the macbook at work and the imac at home, but ineed to have the same data on both macs, how can i sync them?

  • SQL query to get dates between two dates

    Hi,
    We have one table with start date and end date...Now i need to get all dates between start date and end date...
    Table looks like below..
    Create table date_table (start_date date,end_date date);
    Data in the table will be like below:
    start_date            end_date
    01-Jan-2013       04-Jan-2013
    01-Feb-2013       03-Feb-2013
    01-May-2013        03-May-2013
    I want a result as below..
    holiday_dates
    01-Jan-2013
    02-Jan-2013
    03-Jan-2013
    04-Jan-2013
    01-Feb-2013
    02-Feb-2013
    03-Feb-2013
    01-May-2013
    02-May-2013
    03-May-2013
    Can any one helps..?

    select * from date_table;
    START_DAT END_DATE
    01-JAN-13 04-JAN-13
    01-FEB-13 07-FEB-13
    07-MAR-13 12-MAR-13
    select start_date-1+level output from
    date_table connect by level<=end_date-start_date+1
    and prior start_date=start_date and prior sys_guid() is not null
    OUTPUT
    01-JAN-13
    02-JAN-13
    03-JAN-13
    04-JAN-13
    01-FEB-13
    02-FEB-13
    03-FEB-13
    04-FEB-13
    05-FEB-13
    06-FEB-13
    07-FEB-13
    07-MAR-13
    08-MAR-13
    09-MAR-13
    10-MAR-13
    11-MAR-13
    12-MAR-13

  • Ways to get data from the internet with XCode and Objective-C

    Hey guys,
    Thanks in advance for any help. I was simple wondering what the best ways are to get data from the internet to use in an application. For example, is it best to store the data in a MySQL database with PHP and then use C code and MySQL commands to get that data from my Mac app? Is JSON better? Any help would be awesome!
    Josh

    What kind of data are you after?
    Eric

  • Easiest way to send data between a MIDP enabled phone and a PC?

    Well, topic says it all I guess :)
    I need to transfer quite alot of data between a java app ("server") running on my pc, to a java midlet on a mobile-phone ("client" if you will). I've tried reading up on a lot of different techniques on how to accomplish this, but most of it is just fluff, and no good concrete examples.
    So, is it possible to transfer data using a cable connection, infrared, bluetooth, or other?
    And if so, which is the recommended method of transfer?
    Also, some code examples or links to some good tutorials would be heavily appreciated.

    Hi
    I am using infrared to make conection between Pc and Nokia7210.
    Download Pcsuite for Nokiamobile it is easy to copy our jars to mobiles.
    visit Nokia forum to down load PCSuite.
    Hope u got it..
    Satish

  • Need the first day of the year and last day of the year.

    hi all,
    i need a function module which can get me the first day of current year and last day of the current year??
    please help.

    Similar date questions are being asked ALL THE TIME.  Please search.

  • First day of year and next monday of the year

    Dear all;
    Given a year, how do you determine the very first day of that year and the next two mondays for that year...

    Hi,
    user13328581 wrote:
    Dear all;
    Given a year, how do you determine the very first day of that year and the next two mondays for that year...As Sayan hinted, you can use NEXT_DAY to find the next Monday after (not the same as) a given date.
    NEXT_DAY(trunc(SYSDATE), 'MON') next_mondayis the next Monday after today. (You may not need TRUNC in the example above.)
    For the Monday after January 1 of this year:
    NEXT_DAY ( TRUNC (SYSDATE, 'YEAR')
             , 'Monday'
             )If the year happens to begin on a Monday, this will return Jaunary 8, the 2nd Monday of the year; otherwise, it will be the 1st Monday of the year.
    For the 2nd Monday after New Year's Day, add 7 to the expression above.

  • Difference in closing balance of last year and opening balance of next year

    hi all,
    when i see the cumulative balances of bank g/l in T.code-FS10N for the last year and see the balance carried forward in this year , i have found a small amount of difference of Rs.300. I have checked the line item balances and it is showing the balances of last year only. Can anybody please tell me the reason of such difference . Is it a normal feature?
    Thanks-
    SAMRAT

    Hi,
    Please check the last year balance, if that is ok.
    Please carry forward the balance once again, then check.
    FAGLGVTR for new GL
    Note: There may be possibility that after doing the balance carry forward, user may done any back dated posting.
    Thanks and Regards
    Binoj M D

  • Current month and previous months of fiscal year period data

    Hi All,
    My requirement is end user will enter month ie (fiscal year period ) and in report my requiremnt is to show data in two columns 1.Current month data  and
    2.April till date.
    Please let me know how to do this and please send the coding to be done in CMOS.
    Regards

    Hi,
    In your query, you should have following object :
    in filters:
    fiscal period object, with an user entry variable on it (UE_MONTH)
    in rows/ratios:
    Current month column, with your KF and a restriction on 0calmonth2 with an customer exit variable on it (ie: CE_VAR1)
    same for April column. (CE_VAR2)
    in your customer exit, CMOD, step 2, add these two cases :
    WHEN 'CE_VAR1'.
    READ TABLE i_t_var_range WITH KEY vnam = 'UE_MONTH' INTO
                       intern_range.
    CONCATENATE intern_range-low(6) sy-datum+4(2) INTO l_s_range-low.
    l_s_range-sign   = 'I'.
    l_s_range-opt    = 'EQ'.
    APPEND l_s_range TO e_t_range.
    Same for April, add a new case and just replace sy-datum+4(2) by '04'.
    Hope it helps,

  • How to get the first friday of the MARCH and SEPTEMBER month of any year...

    Hello-
    How can we get the first FRIDAY of MARCH and SEPTEMBER month for any given year.
    Any help would be appreciate!
    Thanks,
    Nikhil

    Hi,
    Please use the following function to get first fiday of any month, we have to pass month,year as varchar2 as input to this function and it will return the
    date in char format, we can convert it to date.
    CREATE OR REPLACE FUNCTION find_fri
    (p_month VARCHAR2,
    p_year VARCHAR2)
    RETURN VARCHAR2 AS
    p_friday VARCHAR2(15);
    BEGIN
    SELECT (CASE triM(TO_CHAR(TO_DATE(p_month||'-'||p_year,'mm-yyyy'),'DAY')) WHEN 'MONDAY' THEN TO_CHAR(TO_DATE(p_month||'-'||p_year,'mm-yyyy')+4 ,'DD-MM-RRRR')
    WHEN 'TUESDAY' THEN TO_CHAR(TO_DATE(p_month||'-'||p_year,'mm-yyyy')+3 ,'DD-MM-RRRR')
    WHEN 'WEDNESDAY' THEN TO_CHAR(TO_DATE(p_month||'-'||p_year,'mm-yyyy')+2 ,'DD-MM-RRRR')
    WHEN 'THURSDAY' THEN TO_CHAR(TO_DATE(p_month||'-'||p_year,'mm-yyyy')+1 ,'DD-MM-RRRR')
                                                                          WHEN 'FRIDAY' THEN TO_CHAR(TO_DATE(p_month||'-'||p_year,'mm-yyyy'),'DD-MM-RRRR')
                                                                          WHEN 'SATURDAY' THEN TO_CHAR(TO_DATE(p_month||'-'||p_year,'mm-yyyy')+6,'DD-MM-RRRR')
    WHEN 'SUNDAY' THEN TO_CHAR(TO_DATE(p_month||'-'||p_year,'mm-yyyy')+5 ,'DD-MM-RRRR')
                                                                          ELSE 'OTHER'
                                                                          END) INTO p_friday FROM dual;
    RETURN p_friday;
    END;

  • Exchanging data between a Web Dynpro application and SAP Web Shop

    I'll try to keep this as clear as possible:
    1) We have the SAP Internet Sales system running, which has a series of Business Object classes and corresponding Backend Layer objects that can return data from several sources.
    2) We are able to create our own Backend Layer objects that would return data from a component called IPC, which is a Java component.
    3) I would like a Web Dynpro application to retrieve data from this backend layer object, but I am not experienced enough with Java to know if what I want to do is possible. I don't think that I can use JCo, because I am trying to get a Java component (class?) in Web Dynpro to access a Java class remotely.
    4) I think I am asking is this: is there a way for a Java to Java connection to be created, much like Web Dynpro can use JCo to connect Java to ABAP systems?
    If this is a glaringly obvious question to Java programmers, my apologies!
    - Tony.

    Somebody on another forum recommended using RMI. Which would be the better option in terms of ease of implementation?
    - Tony

  • Get data from a JMS XML queue and save it in a file

    Hi,
    Here I come with my issue again.
    I'm trying to test a JMS XML implementation with ODI 10.1.3.4.0 and my target is a single delimited file.
    I made simple things, my XML contains the following code :
    +<?xml version="1.0" encoding="UTF-8"?>+
    +<test><id>456</id><value>789</value></test>+
    In the target file, I specified that I wanted a header line, the id and the value, separated by a tab.
    I send only one message, before executing the ODI interface or package. The queue is persistant. There's no problem from the queue, I manage to read JMS messages with a little program I made.
    The result is also simple : there's no data in the file (not even the header), though it's well created by ODI, and there's no error in the opertor, it's as everything went well.
    Here is the settings I did in ODI :
    Topology : JMS XML Queue config
    Name : JMSXML_TEST
    Technology : JMS XML Queue
    I've a user and password set.
    JNDI Auth : simple
    The user and password are the same as above.
    JNDI protocole : not defined
    JNDI Driver : org.jnp.interfaces.NamingContextFactory
    JNDI URL : jnp://localhost:1099/?re=test&d=<DTD_FILE>&s=JMSXML_TEST_SCH&JMS_DESTINATION=queue/TestQueue1
    The connection test is OK.
    Model
    The JMS XML model is reversed from the DTD.
    There is only one datastore named TEST with an ID and VALUE columns, and other columns usefull to ODI.
    The target is a file represented by a datastore also named TEST with ID and VALUE columns.
    Project
    I created an interface with the following configurations :
    - The staging area is the sunopsis engine,
    - The source datastore and target datastore are the two described above,
    - The LKM is JMS XML to SQL, the IKM is SQL to File Append
    - The JMS_COMMIT option is set to yes
    - The SYNCHRO_JMS_TO_XML is set to yes
    - I added manually a NEXTMESSAGETIMEOUT in the options list because it was missing
    - The IKM settings are all set to yes (INSERT, TRUNCATE, GENERATE_HEADER).
    I also created a package containing this interface.
    Everything is done in the global context.
    Everything is installed locally on my computer : the program sending the messages, the JMS provider and ODI.
    The problem is I don't know where the problem is and neither ODI.
    In the operator, there is 0 insert and the error code is 0.
    Thanks in advance for any insights.
    Marie
    Edited by: Marie123456 on 21 août 2012 10:36

    Hi,
    Since I still have problems on this subject, I would like to share on how it progresses.
    Currently I have a problem of timeout in step "Truncate XML Schema" with the URL that I mentioned above.
    The exact error is the following : 7000 : null : com.sunopsis.sql.l: Oracle Data Integrator TimeOut : connection with URL [...]
    The connection test is still OK.
    I tried to increase the value in the user's pref but there's no change.

Maybe you are looking for