Adding one year to a date

Post Author: JudyD360
CA Forum: Formula
I want to select clients who received services on or after their first birthday. I have {service.date} and {client.birth_date}. How do I add one year to the birthdate?

Post Author: JudyD360
CA Forum: Formula
Thanks, I'll give that a try. I'm really new at this. I appreciate the help.

Similar Messages

  • One year history of data.....

    Hello, I have created code that produces a table containing one day´s data of fx rates and their values, below is an example of one row in the table:
    2007-11-21, TMS2000     , REUTER, FX SEK,SEK/USD, 0,1590432
    All well so far. Now I want to create one year history of trading days for fx rates and their values, that is some kind of loop that adds to the table for every new trading day.
    One long solution is to create a table and manually insert all the trading days, and then use a cursor to read all the dates and so forth, but that takes time.
    Anyone with some kind of idea how I can do this in a simple and efficient manner?
    All help is greatly appreciated!
    best regards
    Harald

    Ok, sorry, here comes the hardware. The code below creates one day of fx rates for 2007-11-21. I want to have one year of data for all trading days (i.e. monday to friday, maybe some more special condition but roughly monday to friday):
    CREATE TABLE fx_rates_daily AS
    SELECT ex.price_date,
      ex.price_type,
      ex.price_source,
      ex.price_currency,
      ex.cur_cross_name,
      ex.fx_rate_internal
    FROM
      (SELECT price_date,
         price_type,
         price_source,
         price_currency,
         cur_cross_name,
         fx_rate_internal,
         row_number() over(PARTITION BY price_currency
       ORDER BY fx_rate_internal DESC) rn
       FROM tmsdat.a_fxrates fx,
         tmsdat.a_currencies cu
       WHERE fx.price_date = '2007-11-21'
       AND fx.price_type = 'TMS2000'
       AND fx.price_source = 'REUTER FX'
       AND fx.price_currency = cu.currency)
    ex
    WHERE ex.rn = 1
    CREATE TABLE usd_sek_valutan AS
    SELECT DISTINCT price_date,
      price_type,
      price_source,
      price_currency,
      cur_cross_name,
      fx_rate_internal
    FROM tmsdat.a_fxrates fx
    WHERE cur_cross_name = 'USD/SEK'
    AND fx.price_date = '2007-11-21'
    AND fx.price_type = 'TMS2000'
    AND fx.price_source = 'REUTER FX'
    CREATE TABLE FX_RATES_SEK_BASE_CURRENCY AS
    SELECT *
    FROM fx_rates_daily
    UNION ALL
    SELECT *
    FROM usd_sek_valutan
    Delete from FX_RATES_SEK_BASE_CURRENCY
    where cur_cross_name = 'GBP/USD'
    Update FX_RATES_SEK_BASE_CURRENCY
    set price_currency = 'EUR' where cur_cross_name = 'SEK/EUR'
    Update FX_RATES_SEK_BASE_CURRENCY
    set price_currency = 'USD' where cur_cross_name = 'SEK/USD'
    [\code]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Go back one year off a date?

    I have this field {?End Date} and want go back a year. I can do {?End Date} - 365 or is there a better method?

    You can use the dateadd function:
    DateAdd("yyyy", -1, {?End Date})

  • Adding the year to the date in the menu bar

    Is there any way to show the year in the menu bar?

    If this still works it will accomplish what you want.

  • ST03 N for Transaction usage since one year

    Hi gurus,
    I know we can do transaction usage analysys for a period say like year...In ST03 or ST03 N but i forgot how to do thta...could u please tell me how to find out A transaction is been used by which user since one year or some x period of time..
    Thank you

    2 ideas come to my mind :
    One year ! As data is probably exported to a file before being purged, ST03N won't help you. It's better to analyze the exported file (admins usually export to excel file, so that they are able to compare performance at different times, for example to make sure response time does not increase).
    In ST03N, there is a "transaction profile" view or something like that, but I don't think you can get a 2 dimensional table with user and transaction (as ST03N is performance-oriented)

  • No international data plan for one year-???

    Here is the background.  I moved over to Verizon about 4 months ago from Alltel.  I did this because I wanted to be able to have a blackberry with international BBm'ing.  I did not go with ATT because there coverage was spotty in my area.  Since the move, I would say my Alltel coverage was 3x better then the cuurent verizon in my house even with the network extender ( BB don't work well with network extender compare to droids, according to the VZW reps).  I did not stay with Alltel because they did not have the storm2.  I needed 6 lines and a mifi and the local verizon rep told me no problem that they could do one primary line and 5 additonal line plus the mifi but after I signed up they realized that I maxed out at 5 lines on one account and they made me make my 6th line a primary line and then added the mifi to the 2nd account.  More costs per month.  Within a month of having my VZW account, one of my kid went to China and we were able to add the international data plan for her trip so she could BBM us.  No problems.
    Here is the problem.  I am going abroad in 2 days and would like to put the international data plan on 2 phones for the trip.  The rep says he cannot do becaue the polciies have changed with the "xerox" buyout and they won't let me do it for the following reasons.
    1.  I have not had my phones for more than one year even though I paid a deposit on them
    2. I have 7 lines on one account- not true I have one account with 1 primary line and 4 additional lines and I have another account with one primary line and the mifi account.  they are all billed on the same statement.  If they are all "one account" then VZW owes me a refund on the 2nd account's primary line as they cannot have it both ways. 
     We came to verizon for the purpose of BBM’ing when going international and now we cannot use it.  I am paying over $500.00 a month and have not been late on any payments, paid a deposit on the phones, am paying for 2 primary lines and did this a few weeks ago for my daughter and now I cannot add the international option again for a week of vacation abroad?  This is really upsetting and pretty much the last straw if it does not get resolved before this trip.  I should have stayed at Alltel or went to ATT and got an I phone because this is no better.    The rep I talked too was bedeviled by this policy and went two levels up in supervisors and was denied.  They are supposed to call me to resolve this issue tonight or in the morning. 
    {word filter avoidance}

    Update:
    I got a call from my local rep at the store where I bought all the phones.  She said they called corporate and all blocks on my international data plan have been removed?  I will stop by this afternoon and confirm that it has all been done???? I still cannot believe how many hoops I will have had to jump through to get this done as it was done 2 months ago, if it actually gets done.
    If it does not get done then i will be requesting to be let out of my contract for breach of contract on Verizon's part as it was never told to me that I could not have international service for one year after signing up and we were able to do it within a month of signing up initially.  Will post updates

  • Function to find the Last Date of Month One Year Ago - RETURNS ERROR

    I've written sql code which takes a date and finds the Last Day of the Month one year ago. For example,  it takes the date '2015-04-17' and returns the date '2014-04-30'. The code works fine in a query. Now I'm trying to turn this into a function. However,
    when I try to create the function I get the error:
    Operand type clash: date is incompatible with int
    Why is this error being returned?
    Here is my function:
    CREATE FUNCTION dbo.zEOM_LY_D(@Input Date)
           RETURNS date
    AS
    BEGIN;
      DECLARE @Result date;
      SET @Result =  convert(DATE, DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,dateadd(m, -11, @Input)+1),0)),101)
        RETURN @Result;
    END;
    Thanks for any help you can give.
                     

    Stan,
    Thanks very much- that does the trick. I should have said I am using SQL 2008 so EOMONTH is not available to me. I still don't get why I got an error though, since I was treating a date like a date and not like an int.
    Thanks, John
    I think i found the issue but i do not know why it is causing the issue. i think may be the way dates are treated/stored internally..i think dates are stored as no of days after 0001/01/01 but cannot see how this cwould effect..may be somebody else can through
    some light..... 
    if you make it as datetime it will work,
    if you leave it as date - eliminate adding 1...  you should prefer to use dateadd to add/substract dates.
    try this to understand..
    --removed the +1 in the code
    declare @input date
    set @input ='20150503'
    select
    convert(DATE, DATEADD(s,-1,DATEADD(mm,DATEDIFF(m,0,dateadd(m, -11, @Input)),0)),101)
    go
    --made the datatype as datetime
    declare @input datetime
    set @input ='20150503'
    select
    convert(DATE, DATEADD(s,-1,DATEADD(mm,DATEDIFF(m,0,dateadd(m, -11, @Input)+1),0)),101)
    Hope it Helps!!

  • Loading data one year at a time

    Hi,
    We have a situation where we need to load data one year at a time. I saw this done a few years ago but do not remember the details.
    What I am thinking is that we could initially run a full load with the following parameters:
    $$ANALYSIS_START: 1/1/2006
    $$ANALYSIS_START_WID: 1/1/2006
    $$INITIAL_EXTRACT_DATE: 1/1/2006
    $$ANALYSIS_END_WID: 1/1/2006
    And this should give us one year. What I am not sure about is how to load each subsequent year???
    Regards

    Is the issue a performance issue (ETLs running for too long)? The problem is that if you do Year by year..and you want to do a "incremental" load for each year, that would be even more of a load..since you are not allowing for BULK load (where the tables get truncated). Either you can truncate and do BULK or incrmental..which may be an even heavier load. I think you are assuming that this approach will somehow help you from a hardware limitation standpoint..do you know for sure that it will?
    If you really do want to do it, as I mentioned, you can edit the INITIAL and END parameters. It would help if you clarify the Hardware limitation...I think there are better ways to handle this than to do what you are doing.

  • How to set date field in custom form to default to {NOW} plus one year.

    I am developing a subscription site. I have the custom form for inputing a users information. I have the subscribe date set up as a default field of {NOW} that works great.
    Now I need the renewal field to default to exactly one year from the subscribe date.
    Any help would definitely be appreciated.
    thanks in advance

    PHP? http://us2.php.net/manual/en/function.date-modify.php
    Alec Fehl, MCSE, A+, ACE, ACI
    Adobe Community Expert
    AUTHOR:
    Microsoft Office 2007 PowerPoint: Comprehensive Course (Labyrinth
    Publications)
    Welcome to Web Design and HTML (Labyrinth Publications)
    CO-AUTHOR:
    Microsoft Office 2007: Essentials (Labyrinth Publications)
    Computer Concepts and Vista (Labyrinth Publications)
    Mike Meyers' A+ Guide to Managing and Troubleshooting PCs (McGraw-Hill)
    Internet Systems and Applications (EMC Paradigm)

  • Function module to get 'Date one year in the past' in APO

    Hi,
    Required function module to get date one year in the past in APO.
    Thanks and regards,
    M.R.Reddy.

    Hi Reddy,
    Try these function modules
    /SAPAPO/DATE
    /SAPAPO/FISCAL_BDATE
    /SAPPO/MAPI_MAP_CREATDATE
    /SAPPO/MAPI_MAP_POSTDATE
    /SAPAPO/LCP_CALC_DATE
    /SAPAPO/VS_ORDER_GET_DATES
    /SAPAPO/PERIOD_CONVERT_DATE
    /SAPAPO/PERIOD_DATE_GET_FROMTO
    /SAPAPO/PERIOD_GET_DATE_RANGE
    /SAPAPO/PERIOD_GET_FOR_DATE
    /SAPAPO/PERIOD_GET_FROM_TODATE
    Regards
    R. Senthil Mareeswaran.

  • Required function module to get date one year in the past.

    Hi,
    Required function module to get date one year in the past.
    Thanks and regards,
    M.R.Reddy.

    Hello,
    You can check this:
    DATA:
    V_DATE1 TYPE D,
    V_DATE2 TYPE D.
    V_DATE1 = SY-DATUM.
    TRY.
        CALL METHOD CL_HRPAD_DATE_COMPUTATIONS=>SUBTRACT_YEARS_FROM_DATE
          EXPORTING
            START_DATE = V_DATE1
            YEARS      = 1
          RECEIVING
            DATE       = V_DATE2.
      CATCH CX_HRPA_VIOLATED_POSTCONDITION .
    ENDTRY.
    WRITE:
    / V_DATE1, / V_DATE2.
    Hope this helps.
    Br,
    Suhas

  • Dublicate the database with one year data

    Hi DBA's
    I need to create the duplicate database instance. But only one year data from the source instance to target instance, source instance is having 3 years data.
    is it possible to do so? and which method i have to follow to create a Duplicate instance?
    One year data is having in size nearly 1 TB .
    Regards,
    SG

    Please see this thread for similar discussion -- ebs cloning version 11.5.10.2
    Thanks,
    Hussein

  • Web-Outlook appointments which are one year before the current date are removed

    Hi,
    my Web-Outlook works fine with my iPHONE4s but the appointments which are one year befoer the current date are removed.
    Is there an option to keep all appointments?
    regards
    Andreas

    For the OST problem, delete the OST file and let Outlook create a new one.  But your problem may be that Outlook connects to Exchange 2013 using Outlook Anywhere only--MAPI RPC is gone--and for that you need a valid certificate.  So the self-signed
    certificate is likely your main problem.
    For a self-signed certificate to work, you must add it to every client as a trusted certificate.  That is hard to do with mobile devices, which is why it's recommended to obtain a certificate from a trusted public certificate authority.  You'd
    probably find Go Daddy to be reasonably priced, and there are others.
    Ed Crowley MVP "There are seldom good technological solutions to behavioral problems."

  • Error message "Transfer date 30.06.2007 is more than one year after the clo

    Hi SAP expert,
    I received error message "Transfer date 30.06.2007 is more than one year after the closed fiscal year" - message number AC 187. Used Tcode OAAQ when tried to reverse year end closing for depreciation area. How can i correct this problem? I want to finish for the whole year 2007 depreciation.
    Hope u guys can help me. Thanking u in advance.
    Regards,
    Nazrul

    Hi SAP experts,
    any solution for my porblem?
    TQ

  • How do I determine Purchase Date - want to sell within one-year warranty

    Packing slip says my MacBook was shipped on 2/29/08. Is that considered the purchase date? Or would it be when I registered it online?
    I want to sell my MacBook within the one-year warranty period, so that buyer can add AppleCare (I didn't purchase AppleCare because I planned to sell within the first year). Is there somebody at Apple that I can call? Thanks.

    Enter in your information on this webpage:
    https://selfsolve.apple.com/GetWarranty.do
    and you'll get your answer
    ~Lyssa

Maybe you are looking for