Subtract today's date from MonthtoDate

Post Author: LarryA
CA Forum: Formula
Is it possible to remove today's date from date formula like Monthtodate, WeektodayfromSunday, Yeartodate.  On Currentdate I was able to do (CurrentDate - 1) but that does not work with the multidate formulas.

Post Author: LarryA
CA Forum: Formula
I have four columns Yesterday Sales, WTD Sales, MTD Sales, YTD Sales  they are grouped by salesrep, when I run my reports each day I don't want to factor in the sales that are taking place today as I mentioned before I handled yesterday sales by using "currentdate -1" but when I try to use crystal's built in functions for "Weektodatefromsunday", "MonthToDate", & "YeatToDate" and place "-1"  I get the following error "A number, currency amount, date, time, or date-time is required here." 
My fomula looks like this:
if {CONTHIST.ONDATE}= (MonthToDate) then{@Duration}
@duration is my sales amount.

Similar Messages

  • Subtraction of 0Base_line date from 0Clearing date in the Query designer

    Hi
    How to subtract  0Base_line date from 0Clearing date  in query designer??
    I tried using 'Selection' by taking both 0Base_line and 0Clearing date separately in different selection and then subtracting them using formulas. But when i run the query,it is giving error "Use keyfigures in the selection".
    Pls suggest. Itz very urgent.
    Regards
    Deepak.

    Hi
    Thanks for your prompt reply.
    But if any of the date is 'blank' then while subtracting 0Base_line date  from 0Clearing date it is giving some value (like 78,90345).Actually i want *'No of days'* to be displayed.
    Date format is dd/mm/yyyy (12/6/2007)
    Pls help.
    Also i want Grading to be assigned in alphabets(as A, B and C) instead of numbers (1 ,2 and 3). Is there any way in Query designer to achieve such type of grading?
    Pls suggest
    regards
    Deepak

  • How to pass today's date

    hi friends,
    how can i pass today's date from command line. ie,
    rwrun report=c:\report_files\dailyrec.rdf userid=abc/xyz@ora10g place='"Sharq"' t_day =? destype=file desformat=pdf
    thanks

    You may create a Before Report trigger or a Before Parameter Form trigger and put in like...
    function BeforePForm return boolean is
    begin
    IF :p_date_from IS NULL THEN
    :p_date_from := TRUNC(sysdate) ;
    END IF ;
    return (TRUE);
    end;
    and don't pass value it get set today's date.
    DC
    Message was edited by:
    DC

  • I just got a new phone today the iphone 5c and i plugged it into itunes. i wanted to get all of my data from my iphone 4s but when i synced my phone all of my iphone 3 data was on my new phone how do i get my iphone 4 data on my new phone?

    I just got a new phone today the iphone 5c and i plugged it into itunes. i wanted to get all of my data from my iphone 4s but when i synced my phone all of my iphone 3 data was on my new phone how do i get my iphone 4 data on my new phone?

    Did you choose the wrong back up? There should be a drop box when you go to "Restore from Back up" in iTunes and your iPhone is plugged in, on the Summary page. Choose the correct back up. If you can't find one, and you still have your device, back up your iPhone 4 again and then choose that back up. Or check for an old iCloud back up if you have one.

  • "...an error occurred while sending data from the iPhone" - caused by latest iPhone update today?

    I've been syncing my iPhone to my (non-apple) desktop for several months without difficulty.
    Today I accepted the latest upgrade to my iPhone software.
    Since it installed, it will not sync.
    It gives the error message "iTunes could not sync calendars to the iPhone "Steve's iPhone" because an error occurred while sending data from the iPhone."  After rebooting the desktop, the error repeats, and it's now in hour 2 of the continuing message "Syncing Steve's iPhone (Step 2 of 2) - Finishing sync"
    Has anyone else run into this Undocumented Feature of the latest upgrade?
    As bugs go, this is pretty serious for those of us who depend on syncing the iPhone and desktop for our business!
    Thanks to anyone who can help!
    Steve Callender

    Tried rebooting the phone, and now it works.
    Guess there's 2 lessons here -
    Boot again when installing new SW, even if the phone reboots itself during installation, and
    Boot to see if that fixes a problem before posting it.
    Steve

  • How to set default date of 3 weeks(21 days) from today's date during page load?

    I want to show the default date as 3 weeks from today's date during page load.
    For example ,i have given as adf.CurrentDate + 21 in EO for the attribute 'DueDate'. But it is showing me the date as 9.7.2013. 3 weeks default date is not getting set.If i give adf.currentDate also ,it not giving me today's date,it showing the 9.7.2013 only.Kindly provide your suggestions to set the default date as 3 weeks from today's date during page load.Thanks in advance.

    Hi,
    when you set the value on the entity level then you don't want to show it during page load but when the field is empty ? Correct? if so then the use case is a different one. The easiest way to implement this would be to create a Rowimpl class (Java option) and then in the get method of the entity attribute check if the value is null and if it is, set it to the current date + 21 days. This way all rows will be set with the 3 weeks due date but fields are not overridden each time the row is queried
    Frank

  • How do I display today's date and a date 1 month from today in livecycle designer

    Hello,
    Does anyone know how to display a future dates in 3 date fields that would be 1 month; 2 months and 3 months from today?
    I am making a sales contract form and in a date field is today's date (which can be altered if the user needs to change it).  The javascript I have is:
    if 
    (this.rawValue == null){
    var  
    msNow = (new Date()).getTime();
    var  
    d1 = new Date(msNow); this.rawValue
    = util.printd("mmm/dd/yyyy", d1);}
    else  
    { this.rawValue
    = rawValue;
    Then in the next date field i need to display the date 1 month from today
    The third date field 2 months from today
    the fourth date filed 3 months from today.
    Any suggestions would be greatly appreciated.

    Hi Peter,
    If you need to be more exact than adding 30 days then you can use the following code;
    function 
    addMonth(date){
      var year = date.getFullYear();  
      var month = date.getMonth();  
      var day = date.getDate();  month= (month % 12) + 1;  year
    += parseInt(month / 12); 
      var days = daysInMonth(month, year);  
      if (day > days)  {
        day= days;   }
      return new Date(year, month, day);}
     function  daysInMonth(iMonth, iYear){
      return 32 - new Date(iYear, iMonth, 32).getDate();}
    You need to pass in a Date object to addMonth so (assuming DateTimeField1 is your date field);
    NextMonth.rawValue= util.printd("mmm/dd/yyyy", addMonth(
    = util.printd("mmm/dd/yyyy", addMonth(
    Date.parse(DateTimeField1.formattedValue));
    Bruce

  • Determine 3 year old fiscal date from today's date

    I have a requirement where I need to find  fiscal date from current calendar month/getdate. Our fiscal year starts from October and ends on Sept30. Also, I only want what will be fiscal date which is older than 36 fiscal month from todays date. 
     For example:
    If I calculate today It should return like that:
    Oct 2014 - Feb  2015 = 5months
    Oct 2013 - Sept30 2014 = 12months
    Oct 2012 - Sept30 2013 = 12months
    March 2011 - Sept30 2012 = 7months 
    Total #fiscal months=36 or 3 fiscal years
    Resultset should look like that:
    '2011-03-09'
    Thanks in advance!
    ZK

    For the first of your request, meaning getting difference between Specific month and either first day of fiscal year or last day of fiscal year, you can use a table that will hold your fiscal year information and a query like below:
    DECLARE @UserRequestedDate DATE
    DECLARE @FiscalInfo TABLE (FiscalYear SMALLINT, StartDate DATE, EndDate DATE)
    INSERT INTO @FiscalInfo
    SELECT 2010, '10/01/2009', '09/30/2010' UNION ALL
    SELECT 2011, '10/01/2010', '09/30/2011' UNION ALL
    SELECT 2012, '10/01/2011', '09/30/2012' UNION ALL
    SELECT 2013, '10/01/2012', '09/30/2013' UNION ALL
    SELECT 2014, '10/01/2013', '09/30/2014' UNION ALL
    SELECT 2015, '10/01/2014', '09/30/2015'
    SELECT
    ,@UserRequestedDate
    ,DATEDIFF(MONTH, StartDate, @UserRequestedDate) + 1 AS MonthsPassedFromFiscalYear
    ,DATEDIFF(MONTH, @UserRequestedDate, EndDate) + 1 AS MonthsPassedFromFiscalYear
    FROM
    @FiscalInfo
    WHERE
    @UserRequestedDate BETWEEN StartDate AND EndDate
    Which with your samples would be:
    SET @UserRequestedDate = CURRENT_TIMESTAMP
    SELECT
    ,@UserRequestedDate
    ,DATEDIFF(MONTH, StartDate, @UserRequestedDate) + 1 AS MonthsPassedFromFiscalYear
    ,DATEDIFF(MONTH, @UserRequestedDate, EndDate) + 1 AS MonthsPassedFromFiscalYear
    FROM
    @FiscalInfo
    WHERE
    @UserRequestedDate BETWEEN StartDate AND EndDate
    SET @UserRequestedDate = '03/01/2011'
    SELECT
    ,@UserRequestedDate
    ,DATEDIFF(MONTH, StartDate, @UserRequestedDate) + 1 AS MonthsPassedFromFiscalYear
    ,DATEDIFF(MONTH, @UserRequestedDate, EndDate) + 1 AS MonthsPassedFromFiscalYear
    FROM
    @FiscalInfo
    WHERE
    @UserRequestedDate BETWEEN StartDate AND EndDate
    And output would be:
    FiscalYear StartDate
    EndDate (No column name)
    MonthsPassedFromFiscalYear
    MonthsPassedFromFiscalYear
    2015 2014-10-01
    2015-09-30
    2015-02-09 5
    8
    FiscalYear StartDate
    EndDate (No column name)
    MonthsPassedFromFiscalYear
    MonthsPassedFromFiscalYear
    2011 2010-10-01
    2011-09-30
    2011-03-01 6
    7
    And for your second request, something like below may help you
    DECLARE @UserRequestedMonthNo TINYINT = 36
    SELECT DATEADD(MONTH, 1, DATEADD(MONTH, @UserRequestedMonthNo * (-1), CURRENT_TIMESTAMP))
    Best Wishes, Arbi; Please vote if you find this posting was helpful or Mark it as answered.

  • Subtract a numerical value from a database's data

    Hi Everyone!
    I'm just wondering what kind of code/s should i use if i want to subtract the value of a numeric data from a database. Example: Column is Savings. Current Data: $ 25,000(Ignore the sign) , I want to make it 20,000. Does anyone know how i can do this? Any
    help/suggestion will be appreciated.
    Sorry if I don't have any codes. I'm just starting so i really have no idea how to do this.
    P.S. I already created a database. its like overwriting the data in the database.

    Hello,
    The following is conceptual in that it will work with any database, for database specific we need only be concerned with the data provider i.e. for MS-Access OleDb, for SQL-Server SqlClient.
    Create a connection and command object, set the command object CommandText to a SELECT statement with a where clause i.e. SELECT Savings WHERE ID=x where x in the key to the record. Use ExecuteScalar (here is an
    example for usage with SQL-Server) i.e.
    Dim CurrentValue As Decimal = CDec(MyCommand.ExecuteScalar)
    Now in this case we subtract 5,000 and this will be the value for CurrentValue. Now change the CommandText to a UPDATE SQL statement (see example) and this time use MyCommand.ExecuteNonQuery which
    returns a numeric, -1 or 0 is the update failed, 1 success, more than one would happen if there was no where condition.
    As the above is conceptual meaning we write the code the same for any database there is also the case when you connect to the database via IDE database designer. In this case we write the SQL statements in the database designer in the project and call them
    via Fill method of the DataAdapter which is placed on to your form at design time.
    So there are the high level steps, hope that helps. If it does not then we need more details, more details means better responses.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem.

  • I just got my iPhone today and connected it to iTunes but it's saying iTunes was unable to load provider data from sync services?

    I just got my iPhone today from Sprint and connected it to iTunes but it's telling me iTunes was unable to load provider data from sync services. My Safari works somewhat fine but my apps won't load... what's wrong? They're able to start up and then they tell me they're unable to connect. My e-mail that was supposed to be set up earlier disconnected and wouldn't work until I reconnected my wifi and worked for a moment I believe. Now on the bottom of my inbox it keeps saying "checking for mail..." On top of that I think my safari randomly slows down at times because when I started typing this I could move around websites fine and now it's barely loading.

    Time for a restore. Once you do make sure you set the phone up as a new iPhone.

  • Trying to access a page in the cache, but it only has the entries from today's date, even though my history goes back for more than a month. Is it all gone?

    I used the about:cache function and clicked on the option to view the files, but it only shows today's date. I have history for much further back. Have all the cache files been removed? If not, where can I find them? It's somewhat urgent.
    Thanks. :)

    this is normal behaviour - the cache is only a temporary file store & sites can specify if/how long data should be stored. everything that isn't showing up in about:cache is gone

  • How can i get my data from my sync acount when i lost it today

    Firefox has been causing pbs for my MBP OS X ML. So i tried to reinstall it. Removed it form OSX cleaned the system then reinstalled it. When i tried re syncing my data i forgot the password for my account. I had to reset it.
    Then when i tried to re-add my MBP to my sync account it told me do you really want to replace the data from this device with the data on the sync account. I said yes then nothing happened.
    I tried re syncing but nothing happened. I changed the sync option to the second one "replace all data on this device with my sync data" but nothing happened.
    I don't know how to deal with this? can someone help please. Did i lose all my sync data or there is a way to get it back?

    Thank you for your replay, i kind of got that at the end.
    The only solution is starting over or going the other way (chrome's way).
    Since, i'm a gmail user i think the other way is better even if i've been a FF user from over 8years (netscape's years). I thought sync was a good way/tool to handle my stuff and boy i was wrong. If losing all my bookmarks (i'm a massive user) is what it takes to switch, then i'm ok with it.
    This pb with sync and the way it is handled are really stupid , but anyway.
    Someone is going to notice it in the future but...
    Thanks anyway.

  • Calculating date from today to after 2 years

    Hi All,
    I want to convert a date from curret value to the date 2 years after.
    How to do this.
    please reply.
    Previosly i was trying with FM  RP_CALC_DATE_IN_INTERVAL.
    But in the program it is going for dump.
    My code id:
    DATA:    gv_start_date TYPE zavlonerconttemp-created_date,
             gv_end_date TYPE zavlonerconttemp-created_date,
             c_increment VALUE 2,
             c_sign value '+' .
      gv_start_date = sy-datum.
      CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
        EXPORTING
         date            =*
         days            =*
         months          =*
         signum          = c_sign
          years           = c_increment
       IMPORTING
         calc_date       = gv_end_date
       write   gv_start_date.
       write   gv_end_date.

    CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
    EXPORTING
    date = gv_start_date  " u need to give date to which years need to be added how can u comment it.
    * days =
    * months =
    signum = c_sign
    years = c_increment
    IMPORTING
    calc_date = gv_end_date
    кu03B1ятu03B9к

  • Java dates from 0-11 or 1-12

    Hello
    In java Date, the months ranges from 0-11 . first january is thus 1/0/2003 (in dd/mm/yyyy form). But in almost all databases , month values are counted as 1-12 . That is first january becomes 1/1/2003 . Obviously we have to show the users month values from 1-12 and not from 0-11. This obviuosly places some overhead when doing calculations and display. Sometimes there are situations where we have to get the date from database using getString() function, but that will vary with the result of Resultset.getDate() . Any way to overcome such limitations? and why java has such dates?

    I kind of agree. When I first started, I felt that I shouldn't ever rely upon an assumption about the value of a constant field (i.e. Calendar.JANUARY, etc).
    But since I did need to have a user-intuitive interface (both in guis and because we deal regularly with processing today's or yesterday's version of a file named like yyyyMMdd.input), I always provided a class that was a day-only object who did its behind-the-scenes work with Calendar by using switch statements to choose the correct Calendar month constants (rather than by adding or subtracting one).
    But (a) that got old quick because of either the same cumbersome code repeated everywhere or having to have many otherwise simple standalone programs depend on a central utility class to do this, and (b) the Calendar class documentation states that the value of the month is zero-based, so the horror of assuming constant values is not so bad.
    So now I have slightly less cumbersome code (adding or subtracting one) repeated everywhere...

  • Display data from CSV file in iWeb page

    Hi,
    I like to display data from a CSV file in iWeb page if a date value from CSV file matches todays value from the system. Here is an example.
    CSV data values
    01/20/2011,Sunny,87
    01/21/2011,Cloudy,100
    01/22/2011,Rainy,60
    If today's date value is 01/21/2011 the page should display 01/21/2011 Cloudy 100 in a tabular format.
    Appreciate your help in providing HTML code for this issue.
    Thanks

    I suspect there is a soft return in the excel database somewhere that can't be seen. Take the csv/txt file into notepad and look for a line that starts oddly compared to the others.
    I haven't had luck removing soft returns from excel files so I do this a rather odd way. I take the excel file into InDesign as a table, and then use find/change to replace any soft returns with nothing, then convert the text to table and then export the text out again by going export, and selecting text from the dropdown menu.
    For my money, I always save tab delimited text files from excel so that if a field does contain commas, it doesn't "trick" indesign into thinking a new field is beginning or not... instead the field delimiters are tabs and they are unlikely to have been used in the excel database.
    If you do choose to use this indesign import method of mine to clean up the database, i also noticed two things in your screengrab: first was that some fields have spaces at the start of the text... easy enough to fix with a GREP that looks for ^\s (start of a sentence followed by a space) and replace with nothing. The second thing is the T&C field that all entries (at least in the screengrab) all start the same – if all entries in the database start the same, couldn't that line be in the indesign file? Its only a small detail I know.

Maybe you are looking for