Help to  get date before (six month)

hi,
i have to get in field  the date of six month ago  what is the best way to do that?
example.
if now_date = 14.10.07
i wont in l_date 14.4.07
or if now_date =  15.1.2003
l_date = 15.7.2002
Regards

Hi,
For this logic to work,we will have to use the Offset method for the month as well as the Year part of the date.
Please refer to the sample code mentioned below:
data:cur_date type sy-datum.  "Date entered by the user.
data:wanted_date type sy-datum.    "Date six months ago.
if suppose the month for the current date is greater than June,i.e from July to December,then the logic should be,
wanted_date = cur_date + 2(0) - 6.   "Only reduce the month part of the date by 6.
if suppose the month for the current date is either equal to or less than June,i.e
from January to June,then the logic should be,
wanted_date = cur_date + 2(0) - 6.    "Reduce the month by 6.
wanted_date = cur_date + 4(0) - 1.    "For reducing the year by one as the year also gets changed in this case.
I hope you understood my point.
In case you have any further clarifications,do let me know.
Regards,
Puneet Jhari.

Similar Messages

  • Help to get date before

    hi,
    i have to get in field the date of six month ago what is the best way to do that?
    example.
    if now_date = 14.10.07
    i wont in l_date 14.4.07
    or if now_date = 15.1.2003
    l_date = 15.7.2002
    Regards

    Hi,
    There is FM <b>HR_99S_DATE_ADD_SUB_DURATION</b> .This is the sample code.
    PARAMETERS: p_date TYPE datum,
                p_months TYPE psen_durmm.
    CONSTANTS: c_op TYPE adsub VALUE '-'.
    DATA: w_duration TYPE psen_duration,
          w_get_date TYPE datum.
    w_duration-durmm = p_months.
    CALL FUNCTION 'HR_99S_DATE_ADD_SUB_DURATION'
      EXPORTING
        im_date     = p_date
        im_operator = c_op
        im_duration = w_duration
      IMPORTING
        ex_date     = w_get_date.
    WRITE:/ 'Actual Date :', p_date,
          / 'Sub No. of months :', p_months,
          / 'Date :', w_get_date.
    reward the points if helpful.
    Regards,
    Abhijit

  • I have a ifhone 4s ihave a problem in wifi it is gred ilve in a itly but i purches thin one in uk can you help me i bought it in before six month plz

    i have a ifhone 4s ihave a problem in wifi it is gred ilve in a itly but i purches thin one in uk can you help me i bought it in before six month plz

    See this one
    http://support.apple.com/kb/ts1559

  • To get information before one month

    Hi,
    All,
    I have 10.2.0.3 database on AIX.
    I try to create AWR report but there no snapshot available there. what are other alternative to get information before a month.
    Thanks,
    Vishal

    What are you doing and where?
    Run the following to find out for sure:
    set pagesize 0
    set linesize 121
    col instart_fmt noprint;
    col inst_name format a12 heading 'Instance';
    col db_name format a12 heading 'DB Name';
    col snap_id format 99999990 heading 'Snap Id';
    col snapdat format a18 heading 'Snap Started' just c;
    col lvl format 99 heading 'Snap|Level';
    set heading on;
    break on inst_name on db_name on host on instart_fmt skip 1;
    ttitle off;
    SELECT TO_CHAR(s.startup_time,' DD MON "at" HH24:MI:SS') INSTART_FMT,
    di.instance_name INST_NAME, di.db_name DB_NAME, s.snap_id SNAP_ID,
    TO_CHAR(s.end_interval_time,'DD MON YYYY HH24:MI') SNAPDAT,
    s.snap_level LVL
    FROM dba_hist_snapshot s, dba_hist_database_instance di
    WHERE di.dbid = s.dbid
    AND di.instance_number = s.instance_number
    AND di.startup_time = s.startup_time
    ORDER BY snap_id;Taken from the AWR entry in Morgan's Library at www.psoug.org.
    If you need to change the snapshot retention window then look in the library for DBMS_WORKLOAD_REPOSITORY and the MODIFY_SNAPSHOT_SETTINGS procedure. You can set snapshot interval and retention.

  • Need to get data till last month end by using Calday

    Hello SAPiens,
    Could anybody please guide me how to get the data till last month end date.
    Example: If i m executing a report in 05 November 2009 then i should get all the details of last month till last date of the Calmonth. thanks in advance.
    Regards,
    Sandy.S

    Hi,
    you can do the following:
    Create a Customer Variable for Calday
    EXIT_SAPLRSOO_001 ---> Include ZXRSRUO1 write the code for the variable created above
    DATA : date TYPE sy-datum.
    date = sy-datum. "Today
    date+6(2) = '01'. "First day of this month
    date = date - 1. "Previous day before first day of this month = last day of last month
    Or
    you can you many function Modules
    CALL FUNCTION 'RP_LAST_DAY_OF_MONTHS
    FKK_LAST_DAY_OF_MONTH
    OIL_LAST_DAY_OF_PREVIOUS_MONTH
    Santosh

  • Help in  getting Headcount for a month from a flatfile

    Hi All,
    I am need one help regarding i need to load data from a flat file like for eg
    empno  Location     joiningdate     releivingdate
    123       USA         11/3/2008        12/9/2008
    345       Mexico     14/4/2008         13/11/2008
    376       USA         12/2/2008          Null
    and the condition is if the releving date  have some value it should taken  employee left the company
    i need to create a cube and also on top of the cube need to create a report also
    in the query  the formula is
    for eg if the user is giving i/p like 05.2008( what ever the user is giving i/p it should automatically taken from current finanacial year ie april)
    and in the report i need to write a formula for
    %YTD for attrition =( (opening headcount of april 1st+ closing heda count of april end)/2 +opening head count on may 1st + closing head count of may end/2))/n*100
    i am getting stuk up with how to get the opening headcount for month and also the closing head count for a month.
    VR

    There's actually an example of this in the business content in the 0papa_c02 cube:
    Re: Head Count
    There's also some info about this cube in note 336229.
    Similarly, for your data, you might have something like this:
    headcount_vc is the change in headcount on the calday.
    empno      Location      calday        headcount_vc
    123      USA      11/3/2008         1
    345      Mexico      14/4/2008         1
    376      USA      12/2/2008         1
    123      USA      12/9/2008         -1
    345      Mexico      13/11/2008   -1
    There would be another key figure in the cube headcount_nc which is the cumulation of headcount_vc.
    When aggregated together up to a certian day, you will have the correct headcount.
    It can get fancier if need be for example if you want a count of retired employees or something:
    Anything you want counts by should be time dependant though.
    empno      Location      calday        headcount_vc        status
    123      USA      11/3/2008         1          active
    345      Mexico      14/4/2008         1          active
    376      USA      12/2/2008         1          active
    123      USA      12/9/2008         -1          active
    345      Mexico      13/11/2008   -1          active
    123      USA      12/9/2008         1          retired
    345      Mexico      13/11/2008   1          retired

  • Get data for current month in VC from query - Urgent

    Hi all,
    I have designed a query for cube FIAR_C03 for overdue items and query output contains customer, net due date, document date, fiscal year period and amount. I want a chart for that query in VC that only contains those items in which net due date is in current month. How can i do that?
    Where I can place the condition to display only those items in vc in which net due date is in current month and how ?
    Please respond.
    Regards,
    Aisha Ishrat
    ICI Pakistan Ltd.

    Hi Aisha,
    It is possible to do with following steps:
    1. In Query Design make your field 'Net Due' filter with variable for date input (0CALMONTH for example where your date should be this format MMYYYY). Test your query and see if you input a month/year date it would would work;
    2. Build one table from output of your query (choose fields);
    3. In Visual Composer, drag your query into your board and from 'Varaiables' port  (NOT FROM INPUT) drag a line to create a Start point. As soon you realease to create 'Start' a box will ask which fields you want. Choose your date as field;
    4. Select the line between Start point a query. In Input Field assigned the following formula (DSTR(NOW(),'MMYYYY') *
    5. Deploy your model
    at this formula I said: transform NOW(), current date, in Text with format MMYYYY (012002 for example).
    It works!
    Assigned points if was helpful.
    Kind Regards,
    Gilson Teixeira

  • Get date minus 3 months

    Good morning,
    I'm trying to get a string value the contaings the current day minus 3 months.
    thanks

    Hi,
    Thank you for your help, with you suggestions I was able to
    find what I need it
    thanks

  • How to Get DATES of a month

    I want to select all dates that may occur in the month.
    suppose if i enter jun-2008
    then select will return dates from 1-jun-2008 to 30-jun-2008;
    I thought this will be done via using all_objects trick,
    Regards
    Danish Hayder

    It needs a little change in this code -
    satyaki>
    satyaki>select to_date('01-'||upper('&dt'),'DD-MON-YYYY') -1 + rownum dates
      2  from dual
      3  connect by rownum <= (
      4                         last_day(to_date('01-'||upper('&dt1'),'DD-MON-YYYY')) -
      5                         to_date('01-'||upper('&dt'),'DD-MON-YYYY') +1
      6                       );
    Enter value for dt: may-2008
    old   1: select to_date('01-'||upper('&dt'),'DD-MON-YYYY') -1 + rownum dates
    new   1: select to_date('01-'||upper('may-2008'),'DD-MON-YYYY') -1 + rownum dates
    Enter value for dt1: jun-2008
    old   4:                        last_day(to_date('01-'||upper('&dt1'),'DD-MON-YYYY')) -
    new   4:                        last_day(to_date('01-'||upper('jun-2008'),'DD-MON-YYYY')) -
    Enter value for dt: may-2008
    old   5:                        to_date('01-'||upper('&dt'),'DD-MON-YYYY') +1
    new   5:                        to_date('01-'||upper('may-2008'),'DD-MON-YYYY') +1
    DATES
    01-MAY-08
    02-MAY-08
    03-MAY-08
    04-MAY-08
    05-MAY-08
    06-MAY-08
    07-MAY-08
    08-MAY-08
    09-MAY-08
    10-MAY-08
    11-MAY-08
    DATES
    12-MAY-08
    13-MAY-08
    14-MAY-08
    15-MAY-08
    16-MAY-08
    17-MAY-08
    18-MAY-08
    19-MAY-08
    20-MAY-08
    21-MAY-08
    22-MAY-08
    DATES
    23-MAY-08
    24-MAY-08
    25-MAY-08
    26-MAY-08
    27-MAY-08
    28-MAY-08
    29-MAY-08
    30-MAY-08
    31-MAY-08
    01-JUN-08
    02-JUN-08
    DATES
    03-JUN-08
    04-JUN-08
    05-JUN-08
    06-JUN-08
    07-JUN-08
    08-JUN-08
    09-JUN-08
    10-JUN-08
    11-JUN-08
    12-JUN-08
    13-JUN-08
    DATES
    14-JUN-08
    15-JUN-08
    16-JUN-08
    17-JUN-08
    18-JUN-08
    19-JUN-08
    20-JUN-08
    21-JUN-08
    22-JUN-08
    23-JUN-08
    24-JUN-08
    DATES
    25-JUN-08
    26-JUN-08
    27-JUN-08
    28-JUN-08
    29-JUN-08
    30-JUN-08
    61 rows selected.
    satyaki>Hope this will work.
    Regards.
    Satyaki De.

  • Why does my credit get erased after six months?

    why do my kredit get erased if i havn't made calls or send sms for 6 month?
    Post transferred from blog article;
    subject/title edited for clarity.

    Hi, Frank_Disa, and welcome to the Community,
    Please see this FAQ article for more information:
    https://support.skype.com/en/faq/FA10378/what-do-i-do-about-inactive-skype-credit
    Regards,
    Elaine
    Was your question answered? Please click on the Accept as a Solution link so everyone can quickly find what works! Like a post or want to say, "Thank You" - ?? Click on the Kudos button!
    Trustworthy information: Brian Krebs: 3 Basic Rules for Online Safety and Consumer Reports: Guide to Internet Security Online Safety Tip: Change your passwords often!

  • Help, for getting data(photos, songs or vid) from multiple sources.....

    Here is a background of the situation. I've bought my Ipod, October 06. I still don't own a laptop or a PC due to the lack of space of living on a ship(Navy). When I got my Ipod I used a friend's laptop. I installed Itunes on there and was able to import songs I had from my collection of CDs and Photos. Just recently I separated from that command. Now I want to put some new songs and photos I've recently acquired. And I plan to use my girlfriend's laptop. She has her own Ipod therefore already has Itunes installed.
    Now my question is:
    Will I be able to get songs from her Itunes Library(that I've copied from my collection of CDs), AND new photos from her laptop and STILL retain the old songs and photos I already have on my Ipod.
    Thanks!

    heres a more simple answer...YES you can add more songs from your GF laptop or from any PC/laptop for that matter
    Just remember to have oyur IPOD to MANUALLY MANAGE SONGS
    if its in automatic mode, your ipod will be the mirror image of the pc you are syncing in...so if you sync with another pc in automatic, that pc's itunes library will be in your ipod and the old songs will be erased. so be in manual so you could sync from multiple computers.
    As far as pics are concerned, it a totally different matter, you cannot do it manually, since you specify the folder where the pics are stored, it copies whatever is inside that folder and erases the old ones. so pictures in ipod needs to be in just 1 pc, if you transfer to another pc it erases the old ones and brings in the pics from the new pc
    Clear?

  • Please help.........how can i get the last date of the month?????

    Hello....
    I want to get the last date of the month.
    For example, the last date of Jan is 31.
    How can I get the last date of the particular month and year ????
    Thanks for help.
    Gloria

    Hi Gloria
    1. How can I compare the date???date1.compareTo(date2)
    where date1 and date2 is a java.util.Date Object
    will return 0 if it is the same date
    or
    date1.after(date2)
    where date1 and date2 is a java.util.Date Object
    will return true if date1 is after date2
    (the same for date1.before)
    2. How can I change the date format into yyyymmdd format???? I just want the year, month and date.try the java.text.SimpleDateFormat Object
    new SimpleDateFormat("yyyymmdd").format(yourdate)
    Hope this help.
    Please also have a look at a calendar I wrote, (maybe it help)
    demo & source :
    http://www.geocities.com/globe_software/java/components/
    globe_sa

  • In urgent need of help regarding getting month name and dates

    Hi Experts
    I have a table called MONTHLYBILL with Column TRANSACTIONMONTH. I need one query / function / SP to do return ouput based on following combination. I am using Oracle 9i
    Have researched on various forums, documents but unable to get the desired output. Finally here in hope of help.
    Input
    From Date: 06/01/2011
    To Date: 12/03/2011
    Output
    Month: DECEMBER-2010 (previous month of From Date). Now if DECEMBER-2010 is not available in table, then returns the
    month which is available immediately the month preceeding DECEMBER-2010
    Begin Date: 01/01/2011 (1st day following the month returned in output)
    End Date: 31/03/2011 (last date of month based on input To Date)
    Input
    From Date: Null
    To Date: 12/03/2011
    Output
    Month: First available transactionmonth in DB (say JANUARY-2010)
    Begin Date: 01/02/2011 (1st day following the month returned in output)
    End Date: 31/03/2011 (last date of month based on input To Date)
    Input
    From Date: Null
    To Date: Null
    Output
    Month: First available transactionmonth in DB (say JANUARY-2010)
    Begin Date: 01/02/2011 (1st day following the month returned in output)
    End Date: Current month's last date

    What is your application release?
    I am in big trouble now.. can anyone help....
    I have a backup of an EBS instance, lets say it was taken one month ago, and now we got some datas lost in the current production server..
    some one deleted some datas...
    Now we need some specific data from the old backup and restore it to the production
    or can it be restored? please help me guys...What kind of data? What is the table name?
    Since this is a production issue, I would suggest you log a SR.
    Thanks,
    Hussein

  • Anyone help me ...I am writing to get Date, Month and Year...I got errors

    Could some body help me:
    I am try to get Date, Month and Year
    I got stuck, Anyone help me this:
    public class DateMonth
    public static void main(String[] args)
    toDay = new toDay("February 21, 2002");
    dayofWeek = today.getDay();
    System.out.println("Current month is " + toDay.getMonth());
    System.out.println("Current day is " + getDate());
    System.out.println("Current year is " + toDay.getYear());
    toDay.setDate(toDay.getDate()+60)
    System.out.println("Sixty days from now is ");
    System.out.println(toDay);
    }

    Try something like this:
    import java.util.*;
    public class DateMonth {
         public static void main(String[] args) {
              // Note: 0 = January
              Calendar calendar = new GregorianCalendar();
              System.out.println("YEAR: " + calendar.get(Calendar.YEAR));
              System.out.println("MONTH: " + calendar.get(Calendar.MONTH));
              System.out.println("WEEK_OF_YEAR: " + calendar.get(Calendar.WEEK_OF_YEAR));
              System.out.println("WEEK_OF_MONTH: " + calendar.get(Calendar.WEEK_OF_MONTH));
              System.out.println("DATE: " + calendar.get(Calendar.DATE));
              System.out.println("DAY_OF_MONTH: " + calendar.get(Calendar.DAY_OF_MONTH));
              System.out.println("DAY_OF_YEAR: " + calendar.get(Calendar.DAY_OF_YEAR));
              System.out.println("DAY_OF_WEEK: " + calendar.get(Calendar.DAY_OF_WEEK));
              // 60 days from now
              calendar.add(calendar.DATE, 60);
              System.out.println("\nSixty days from now");
              System.out.println("MONTH: " + calendar.get(Calendar.MONTH));
              System.out.println("DATE: " + calendar.get(Calendar.DATE));
              System.out.println("YEAR: " + calendar.get(Calendar.YEAR));
    }Remember that January is 0!
    Take a look at the GregorianCalendar class:
    http://java.sun.com/j2se/1.3/docs/api/java/util/GregorianCalendar.html
    Hope this helps!
    DesQuite

  • When I purchased my Mac six months ago, I transferred my Quicken data to Quicken Essentials which has worked well for me until yesterday.  Now Quicken Essentials will not open the data file.  What happened?  How do I get back in?

    When I purchased my Mac six months ago, I transferred my Quicken files to Quicken Essentials.  That worked fine until yesterday.  Now I'm getting messages that there is not application to open the files, or that it just plain can't open the file.  What gives here?  What happened?  How can I get back in?

    Launch the Quicken application and try to open the file from there, if you haven't already. If that fails, and a simple restart of the computer doesn't help, try reinstalling the application. If that doesn't cure the problem, I would suggest you take this up in the Quicken Community:
    https://qlc.intuit.com/app/full_page
    or with Quicken support:
    https://quicken.custhelp.com/app/contact/plvl1/win
    You'll be most likely to get further help with your issue there.
    Regards.

Maybe you are looking for