Release date of variable text for the previous month?

I'm automating a package of reports based on the data received on the following month, day 8. I need models to pull in the month statement , not the month I publish to the course. Is it possible to perform such a feat? See you soon.

You simply define the content of a block of text with the variable.

There are several ways to do so, but if you put something weird in the model as XXXXXXXX you can use a search/replace.

var x = new Date();

with (x)

{

setDate (1);

setMonth (getMonth () - 1);

}

var months = new Array();

months [0] = "Jan";

months [1] = "Feb.";

months [2] = "March";

months [3] = "April";

months [4] = "may";

months [5] = "June";

months [6] = "July";

months [7] = "Aug.";

months [8] = 'Seven.';

months [9] = "October";

months [10] = "Nov";

months [11] = 'Dec.';

var y = x.getFullYear ();

var m = month [x.getMonth ()];

var lastmonth = m + "" + y;

myDocument var = app.activeDocument;

Clear the find/change text preferences.

app.findTextPreferences = NothingEnum.nothing;

app.changeTextPreferences = NothingEnum.nothing;

Set the search options.

app.findChangeTextOptions.caseSensitive = false;

app.findChangeTextOptions.includeFootnotes = false;

app.findChangeTextOptions.includeHiddenLayers = false;

app.findChangeTextOptions.includeLockedLayersForFind = false;

app.findChangeTextOptions.includeLockedStoriesForFind = false;

app.findChangeTextOptions.includeMasterPages = false;

app.findChangeTextOptions.wholeWord = false;

Search the document for the string "XXXXXXXX" and change it to "text".

app.findTextPreferences.findWhat = "XXXXXXXX";

app.changeTextPreferences.changeTo = lastmonth;

myDocument.changeText ();

Clear the find/change text preferences after the search.

app.findTextPreferences = NothingEnum.nothing;

app.changeTextPreferences = NothingEnum.nothing;

That save you and run when you open the document.

Read the Guide to the script is a good thing to do no matter if it works for you, this time.

Don't forget to mark this as replied to what works for you.

Tags: InDesign

Similar Questions

  • How to get the last date of 3 days for the current month?

    Hello. Guy

    How to get the last date of 3 days for the current month?

    MY OUTPUT WOULD LOOK LIKE THIS

    JANUARY 29, 2016

    JANUARY 30, 2016

    JANUARY 31, 2016


    GUYS HELP ME / / /...

    SQL > select last_day (sysdate) - level + 1 double connect by level<= 3="" order="" by="">

    LAST_DAY)

    ---------

    29 JANUARY 16

    30 JANUARY 16

    31 JANUARY 16

  • DAY MONTH FOR THE previous month

    Hello

    I invited where I have dates like below

    31/03/2012
    30/04/2012
    When I clcik 30/04/2012, I need previous months the other day, then the result should be 31

    When I give it as this TIMESTAMPADD (SQL_TSI_DAY,-30, DATE ' @{pvdate} "")... I get previous full day 31/03/2012
    When I give it as this DAYOFMONTH (DATE ' @{pvdate} "")... I get months current 30 day

    How to get the previous month of day?

    If you use guests then SQL result or in the SQL report to filter or fx on column

  • Variable repository for the last month

    Hi gurus,

    I have a requirement to create a repository for the last month variable first day. We have no dimension of the day.

    i, e I should get 1 day last month.

    example: today is 29/07/2009 the variable repository should give me on 01/06/2009.
    If I am on 08/01/2009 the repository variable should give me 01/07/2009.

    Thanks adavance.

    Hello

    There are several ways to find it,
    The following query in the initialization block gives you the result want.

    Select last_day (add_months (sysdate-2)) + 1 double

    Concerning
    Kishore Guggilla

  • Filter a report to take the date of closing days for the current month

    Hello.

    I need to create a filter on to only opportunities extraction that are expected to close for the month that we are in a report. By that I don't want to not just Augustus, but regardless of the current month is that the report is run

    The date 'Should close' is a timestamp field in our OnDemand.

    Thank you!

    Hi, you can create a SQL filter as below

    YEAR ("Closing Date". Date) = VALUEOF (NQ_SESSION. CURRENT_YEAR) AND MONTH (the "Closing Date". Date) = VALUEOF (NQ_SESSION. CURRENT_MONTH)

    Hope this works

    -John CRMIT

  • ORA-01839: invalid date for the specified month

    Hello

    I don't know if this is the right place for posting this... but I got the following errors in my alert log file (10.2.0.1)

    Errors in the fichier.../bdump/xxx_j000_23928.trc
    ORA-12012: error on auto work 8888
    ORA-01839: invalid date for the specified month

    in the trace file:
    NAME OF THE ACTION: (AUTO_SPACE_ADVISORY_JOB) 2009-03-30 22:00:02.313
    NAME OF THE MODULE: (DBMS_SCHEDULER) 2009-03-30 22:00:02.313
    SERVICE NAME: (SYS$ USERS) 2009-03-30 22:00:02.313
    ID OF THE SESSION: (194,87) 2009-03-30 22:00:02.313
    2009-03-30 22:00:02.313
    ORA-12012: error on auto work 8888
    ORA-01839: invalid date for the specified month

    The problem is the date is not valid for the specified month, my question is how do I solve this problem. This is a newly created database.

    I have only 2 jobs (some from dba_jobs) and there is no 8888.

    2 jobs I have are:

    THE WORK INTERVAL WHICH
    1 + 1/240 sysdate unlock;
    trunc (sysdate) 2 + 7 + 3/24 dbms_stats.gather_schema_stats ('db_name');


    Please help. Thank you.

    Published by: user10427867 on March 31, 2009 12:00

    The work is probably assigned a group of windows, probably MAINTENANCE_WINDOW_GROUP. The task will run in this window. Try these queries.

    select schedule_name
    from dba_scheduler_jobs
    where job_name = 'AUTO_SPACE_ADVISOR_JOB';
    
    select next_start_date
    from dba_scheduler_window_groups
    where window_group_name = 'MAINTENANCE_WINDOW_GROUP';  -- or the value returned by the first query if different
    

    Since it is a work of Oracle supplied, I recommend you contact Oracle support. The trace file contains other useful information?

  • retrieve December as the previous month in 2013

    All,

    I used this code to retrieve the previous and upcoming months last year that worked very well...
    If the date was for example September 7, then a list of the previous months must be shown, and a list of the next months including the current month.
       select  to_char(to_date(level,'mm'),'FMMonth') month
       from  dual
       connect by level < to_number(to_char(sysdate,'mm'))
    
     
    MONTH
    ---------
    January
    February
    March
    April
    May
    June
    July
    August
     
     select  to_char(add_months(sysdate,level - 1),'FMMonth') month
      from  dual
     connect by to_number(to_char(add_months(sysdate,level - 1),'mm')) != 1
     
     
    MONTH
    ---------
    September
    October
    November
    December
    Now we are in January 2013.
    When I run the code for the previous months, there is no line. It is right that there is no previous month again in 2013.

    I would like to extend the code to display December 2012 as the previous month at the beginning of the year.
    How can I achieve this?

    Thank you
    Diana

    Hello

    Try this:

    select
      to_char(trunc(add_months(sysdate, -level) ,'month'),'FMMonth-yyyy') previous_months
    
    from
      dual
    
    connect by
      level <= case when to_number(to_char(sysdate,'mm')) = 1 then 12
                    else to_number(to_char(sysdate,'mm'))-1 end
    
    order by
      add_months(sysdate, - level)
    

    If wew replace sysdate with date ' 2013-01-08' then it results in:

    select
      to_char(trunc(add_months(date '2013-01-08', -level) ,'month'),'FMMonth-yyyy') previous_months
    
    from
      dual
    
    connect by
      level <= case when to_number(to_char(date '2013-01-08','mm')) = 1 then 12
                    else to_number(to_char(date '2013-01-08','mm'))-1 end
    
    order by
      add_months(date '2013-01-08', - level)
    ;
    PREVIOUS_MONTHS
    ---------------
    January-2012
    February-2012
    March-2012
    April-2012
    May-2012
    June-2012
    July-2012
    August-2012
    September-2012
    October-2012
    November-2012
    December-2012   
    
     12 rows selected 
    

    If we replace sysdate with date ' 2013 - 02 - 08, then we get:

    select
      to_char(trunc(add_months(date '2013-02-08', -level) ,'month'),'FMMonth-yyyy') previous_months
    
    from
      dual
    
    connect by
      level <= case when to_number(to_char(date '2013-02-08','mm')) = 1 then 12
                    else to_number(to_char(date '2013-02-08','mm'))-1 end
    
    order by
      add_months(date '2013-02-08', - level)
    ;
    
    PREVIOUS_MONTHS
    ---------------
    January-2013    
    

    Same thing for 2013 - 05-08 "

    select
      to_char(trunc(add_months(date '2013-05-08', -level) ,'month'),'FMMonth-yyyy') previous_months
    
    from
      dual
    
    connect by
      level <= case when to_number(to_char(date '2013-05-08','mm')) = 1 then 12
                    else to_number(to_char(date '2013-05-08','mm'))-1 end
    
    order by
      add_months(date '2013-05-08', - level)
    ;
    
    PREVIOUS_MONTHS
    ---------------
    January-2013
    February-2013
    March-2013
    April-2013      
    

    Kind regards

    Peter

  • For the previous fiscal quarter date settings?

    Hello people,
    I have this requirement to choose the dates for the previous quarter. a fiscal quarter is usually January 2011 - March 2011. But in my case, the exercise should be December 2010 to February 2011 and if I check in June 2011 it must return to Mar 2011 until May 2011 and so on. So, how can I optimize to be able to select these dates i.e. 01/12/2010 until 28/02/2011 in where clause for the current date?
    create table test_A (id int, col varchar(50),change_date date);
    
    insert into test_A values(1, 'A',to_date('20101201 000000', 'YYYYMMDD HH24MISS'));
    insert into test_A values(2, 'A1',to_date('20110122 000000', 'YYYYMMDD HH24MISS'));
    insert into test_A values(3, 'A1',to_date('20110202 000000', 'YYYYMMDD HH24MISS'));
    insert into test_A values(5, 'A1',to_date('20110306 000000', 'YYYYMMDD HH24MISS'));
    insert into test_A values(6, 'A1',to_date('20110305 000000', 'YYYYMMDD HH24MISS'));
    insert into test_A values(7, 'A1',to_date('20110307 000000', 'YYYYMMDD HH24MISS'));
    
    
    
    select * from test_A
    1     1     A     12/1/2010
    2     2     A1     1/22/2011
    3     3     A1     2/2/2011
    4     5     A1     3/6/2011
    5     6     A1     3/5/2011
    6     7     A1     3/7/2011
    
    
    I only want to see the following
    
    1     1     A     12/1/2010
    2     2     A1     1/22/2011
    3     3     A1     2/2/2011
    select  *
      from  test_A
      where change_date >= add_months(trunc(sysdate,'Q'),-1)
        and change_date <  add_months(trunc(sysdate,'Q'),2)
    /
    
            ID COL                                                CHANGE_DATE
    ---------- -------------------------------------------------- ---------------
             1 A                                                  20101201 000000
             2 A1                                                 20110122 000000
             3 A1                                                 20110202 000000
    
    3 rows selected.
    
    SQL> 
    

    SY.

  • Difficulty accessing data by using the function of Ago - the end of the previous month

    Hey,.

    Recently, I met a problem that I can't fix on my own.


    I need to compare my portfolio to the current date / specified with the portfolio for intelligence and for the end of the previous month (the last day of the previous month).

    It looks like this :

    Capture.JPG

    My fact table consists of the list of contracts of loan that is updated daily. The data for the new day are added to the table, which actually resemble a large sandwich of various portfolios.


    To recover the data for the current/specified date and intelligence is not a problem. Current date - the date is read (can 10.08.2014), the day before - I use the Ago function (e.g., 09.08.2014).

    The real problem is getting the data for the last day of the month previous (e.g. 31.07.2014), since I can't put a specific to the function of Ago offset (10 days in our example), as the number of days from the end of the previous month is constantly - changing is a daily report.


    The best solution would be setting the offset function there is a dynamic value, which would change according to the user selects the date of the report. Can be based on the number of days in the month. BI strictly prohibits using anything that is not an integer in the offset value, so this isn't an option.


    I tried a work around using formulas in columns, like: FILTER ('facts of agreements'. "" Outstanding "USING ("Posting Date". "" Id of the day ' = TIMESTAMPADD (SQL_TSI_DAY, TIMESTAMPADD (1), (SQL_TSI_DAY, 'Date of Report'.) "Number of the day in the month" *-(1) + 1, DATE ' @{report_date}'))). "

    It did not work, since the data I receive are dated the last day of the previous month and date, which is applied to get the data for the current date filter / specified, it cuts.


    Tried to create another time the hierarchy, with the ends of period (week, month, quarter, year) and use it as a level at the Ago. He does work in part, offset the end of 1 month, but I can't bind the data, I get to the date of the report, as the Ago function returns random dates.


    I tried to search if people have had the same problems and it seems I'm the only one. I'm really desperate at this point, not even sure it's possible to get the result I need everything.

    So, please advise!


    Aurore

    Finally got sorted! Hoorey!

    Here's how it's done:

    I created a presentation variable 'report_date' for the user to choose the date of the desired report. That this formula has added to the column:

    FILTER ('facts of agreements'. "" Outstanding "USING ("facts of agreements". (("" Days late max "> 30))-there is (FILTER ('facts of agreements'. "" Outstanding "USING ("facts of agreements". ((("" Days late max "> 30)), TIMESTAMPDIFF (SQL_TSI_DAY, TIMESTAMPADD (SQL_TSI_DAY, DAYOFMONTH (DATE ' @{report_date}') *-1, DATE ' @{report_date}" "), DATE ' @{report_date}'))

    Basically, this formula is used to calculate the difference between the current amount of the portfolio and the amount of portfolio for the last day of the last month (or at the end of last month), where only loans with number of days late over 30 are included.

    In the service there, I used a TIMESTAMPDIFF as a compensation formula to calculate the difference in days between the date of the report and the end of last month. Now no matter what date the user chooses it will give the correct difference in days.

    Really easy, but it took me a little time to get there.

    Hope this helps someone

  • Display the previous month data based on the chosen date

    Hi all

    I need the report of this requirement:

    The user selects an "Invoice Date" with guests, then it should be able to view the data of the previous month until the date (i.e.; If he chooses on 6 July in the hour that I need to view the data of June 6). How can I achieve this?

    Thank you
    Jerome

    Hi timestampadd function used in your filter.

    At the command prompt have a variable presentation as invoice_date and your report using the filter as below,

    "The date of the invoice" > = timestampadd(sql_tsi_day,-30,'@{invoice_date}')
    and "Date of the invoice.<=>

    Published by: kart on July 6, 2010 11:24

  • Extract the first and the last Date of the previous month

    This seems to be a delicate but again it is perhaps easy for some of you people.

    Here is how I find the previous month

    Any ideas on how to get the first and last date of the previous month?

    Thanks in advance.

    Hello!

    SQL>
    SQL> select last_day(add_months(sysdate,-1)) from dual;
    
    LAST_DAY
    --------
    28.02.10
    
    SQL> select trunc(add_months(sysdate,-1),'MM') from dual
    
    TRUNC(AD
    --------
    01.02.10
    
    SQL> 
    

    T

  • Except for the previous version and after!

    Hello

    This is an application for all users to post in the Discussion forum OR. Please register your VI for the previous version (at least at 8,6) before posting because the people who know your best solution may not be the latest version that becomes difficult for them to solve.

    Then more easily and get the fastest solution...

    I have a comment.

    Code snippets.

    Use them wisely.

    Tone

  • How to set remote spaced further icon to display more text for the name below?

    Windows 7 desktop has many icons with similar names. I want that name under the icon. How to set remote spaced further icon to display more text for the name below?

    Right-click on the desktop and select Personalize.

    Select the color of the window

    Select the appearance settings advanced.

    Select the drop down next to the element

    Go down and select icon spacing (Vertical)

    change spacing next to size according to the needs.

  • Ive bought and downloaded adode acrobat Pro DC and its now asking me for the previous issue. I don't have it. He told me to uninstall the previous version of adobe so I did I don't have the password for the trail version more. How can I fix? I cannot ope

    Ive bought and downloaded adode acrobat Pro DC and its now asking me for the previous issue. I don't have it. He told me to uninstall the previous version of adobe so I did I don't have the password for the trail version more. How can I fix? I can't open any pdf on my computer now.

    Hi brets49833316,

    If you have purchased Adobe Acrobat Pro DC as an upgrade, then a serial number of the previous version which you have like Acrobat X or XI. If in the case where you have not bought one of these in the past, then you must buy Acrobat Pro DC as full version (US $449.00).

    In this scenario, you can return the version upgrade and purchase the full version. To return the Contact Customer Service

    Thank you

    Abhishek

  • I can't install my AD018640672 order number because you ask for the previous issue. Adobe came with my computer I don't have that. Can you help me!

    I can't install my AD018640672 order number because you ask for the previous issue. Adobe came with my computer I don't have that. Can you help me!

    Hi bobj39626549,

    We could certainly help you.

    If she asks for the previous version number, then you could acquire a version upgrade.

    You must purchase the full Acrobat version so that it can be installed and activated with the serial key.

    Hope that helps.

    Kind regards

    Ana Maria

Maybe you are looking for