Add the number of days of the week to date

Currently I have the following in place, formcalc code which adds a number of days (based on a calculation different field "TotalDays") on a date, but would like for the calculation of the new date to include only during the week.

Is there a way to do this?

var begindate = Date2Num (xfa.resolveNode ("SecB\. Date\.4'), "YYYY-MM-DD")

$= Num2Date (begindate + TotalDays, "YYYY-MM-DD")

Thank you.

Hello

Here is an example which will add figures given from Monday to Friday at your selected date excluding Saturday and Sunday.

var dp = "MM/DD/YYYY" ; date pattern
var d = Date2Num($.formattedValue, dp) ; selected date to number
var p = 9 ; Number of days to add to the selected date

for i = 1 upto p do
          d = d + 1
          while (Num2Date(d, "e") eq 6 or Num2Date(d, "e") eq 7) do
                    d = d + 1
          endwhile
endfor

DateField2.formattedValue = Num2Date(d, dp)

Tags: Adobe LiveCycle

Similar Questions

  • Identify the weekend and the days of the week a date and update the empty column

    Hi, I look at previous posts that are similar to my question, but nothing helps.

    I have a column called incident_date that is in this format and comes from the Nov_Final table
    01-JUL-2009 20.10
    04-NOV-2009 17.00
    16-DEC-2009 16.00
    In Nov_Final, I created a column called weekend

    What I want to do is to perform an update, something like this:
    Update Nov_Final
    
    SET Weekend=(case when Incident_date ='WEEKEND' THEN 'Y' ELSE 'N' END)
    Banner:
    Oracle Database 11 g Release 11.2.0.2.0 - 64 bit Production
    PL/SQL Release 11.2.0.2.0 - Production
    "CORE 11.2.0.2.0 Production."
    AMT for Linux: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - Production
    Weekend would be Saturday or Sunday. 
    In short I need to find out if the incident_date falls on a weekend and if it does update the weekend column as 'Y' else 'N' if it's not.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            

    You can use TO_CHAR function with a format mask as "fmDAY" to your needs:

    with t_data
    as
    (
    select sysdate + level as col1 from dual connect by level <= 7
    )
    SELECT
        col1,
        TO_CHAR(col1,'fmDAY') col_day,
        CASE
            WHEN TO_CHAR(col1,'fmDAY') IN ('SATURDAY','SUNDAY')
            THEN 'Y'
            ELSE 'N'
        END AS weekend_ind
    FROM
        t_data;
    
    COL1                      COL_DAY                     WEEKEND_IND
    ------------------------- --------------------------- -----------
    08-NOV-11 07:54:12        TUESDAY                     N
    09-NOV-11 07:54:12        WEDNESDAY                   N
    10-NOV-11 07:54:12        THURSDAY                    N
    11-NOV-11 07:54:12        FRIDAY                      N
    12-NOV-11 07:54:12        SATURDAY                    Y
    13-NOV-11 07:54:12        SUNDAY                      Y
    14-NOV-11 07:54:12        MONDAY                      N           
    
    7 rows selected
    
  • Add the new column data IF

    Hi, can someone help with this...



    Select entered_on_date as START_DATE
    due_by
    id
    Object
    status
    resolution_date
    closed_date
    of XT_PORTAL
    where entered_on_date > = ' 01-SEPT.-10'
    entered_on_date ASC order

    which works very well.
    you want to put the new column entitled late...
    If closed_date is > resolution date fill in the column 'late' with 'Y '.
    If closed_date < resulution date fill in the 'overdue' column with "n".

    Published by: user11299998 on 10 Sep, 2010 08:02

    You can add additional code to deal with closed_date = resolution_date and if are NULL, but it's a start:

    CASE
    WHEN closed_date > resolution_date THEN 'Y'
    WHEN closed_date < resolution_date THEN 'N'
    END overdue
    
  • Failed to add the source of data for local SQL Server Express

    I can't get the new data source to connect to a local SQL Server Express (2008).

    SES, I activated authentication NTLM-no, created an account specifically to CFServer and was able to connect to SQL Server through Management Studio. But the data source does not always connect.

    When I enter computerName/SQLServerName for the server, I get a message saying '... The instance requested is invalid or not running. »

    When I get home just to SQLServerName, the message says "socket creation error. Unknown host: SQLServerName. »

    When I get home (local), I get a message saying "error creating socket. "Unknown host: (local).

    When I enter 127.0.0.1, message says "error creating socket to host and port: 127.0.0.1:1433.» "Reason: Connection refused: connect".

    I don't know why the first is considered non-valid, or why the fourth refuses connection. I forgot something?

    I found the solution, that doesn't have to do with Coldfusion, but rather with the configuration of SQL Server to TCP/IP.  In case anyone else ever gets on this post with a similar problem, I wrote on this topic to http://forums.devshed.com/ms-sql-development-95/trying-to-connect-to-sql-server-on-localho st - 1433 t - 958558.html.

  • How to get the number of days

    Hai bloggers,
    See us have 365 days a year for all first half we'll have 180 + days (if we choose first half as the guest and we select week as guest number and the last date of this particular week must indicate in the report) and the number of days until this date or a week should also display... If we choose the second half and half week number it should show number of days until this week and more Date of this issue of the day week should be from 1 to 180 + only way (July 1 m is 1)

    Thank you

    You must use the timestampdiff function to calculate the number of days. One of the way to calculate is how

    cases where "Time". "" Calendar semester "= 1 then timestampdiff (SQL_TSI_DAY, CAST (EVALUATE ('TO_DATE (%1, %2)','' 01-01 |' @{YEAR} {2010}',"DD-MM-YYYY") AS DATE), cast OFF (EVALUATE ('TO_DATE' (1%, 2%), 30-06' |' @{YEAR} {2010}',"DD-MM-YYYY") AS DATE)) else timestampdiff (SQL_TSI_DAY, MOUNT (EVALUATE ('TO_DATE (%1, %2)','01-07' |' @{YEAR} {2010}',"DD-MM-YYYY") AS DATE), cast OFF (EVALUATE ('TO_DATE' (1%, 2%),' 31-12 |' @{YEAR} {2010}',"DD-MM-YYYY") AS DATE)) end

    If you want to calculate between the 1st day of the half and the last date a week then after

    cases where "Time". ' ' Calendar semester ' = 1 then timestampdiff (SQL_TSI_DAY, CAST (EVALUATE ('TO_DATE (%1, %2)','01-01' |' @{YEAR} {2010}', 'DD-MM-YYYY') AS DATE), MAX (MAX ("Time".) "Calendar Date"))) else timestampdiff (SQL_TSI_DAY, CAST (EVALUATE ('TO_DATE (%1, %2)','01-07' |' @{YEAR} {2010}', 'DD-MM-YYYY') AS the DATE), MAX (MAX ("Time".) " End Calendar Date")))

    Hope that it will answer your question

    Thank you
    Phani.

  • SQL to count the number of days of January with a range of dates

    I have data like this, how to calculate the number of days with January in this date range.

    BEGINNINGENDDAYS OF JAN
    12/12/201320/01/201420
    21/01/201402/02/201411

    Hello

    So, you want to count the number of days between

    (a) either start_dt, or January 1, 2014 (prevailing later) and

    (b) or end_dt or January 31, 2014 (whichever comes first).

    However, if start_dt and end_dt are prior to January 2014 (or both are later) which will result in a number negative if you take the difference or 0, if it is higher.

    This looks like a job for the GREATER and LESS than functions.

    SELECT start_dt - START is not a column name good

    , end_dt - is neither END

    BIGGER (1 + LESS (end_dt, DATE ' 2014-01-31'))

    -Most GREAT (start_dt, DATE '' 2014-01-01)

    * v

    ) AS jan_days

    FROM table_x

    ;

    If you would care to post CREATE TABLE and INSERT instructions for some examples of data, then I could test it.

  • Add the 2 columns to date

    Hi all

    I have a requirement where I have a column date and number in the other column. Its similar is Hire_date column that has a value of date (2009-01-17) and the other column is the Service over the years which is like a number (5).

    Now, I have to add one more column who should add the two columns (date of hire + Service over the years) and give the voltage output (17/01/2014).

    Can someone help me please how can I do this in OBIEE report.

    Thanks in advance!

    Any help would be very crowded.


    correct your expression;

    TIMESTAMPADD (SQL_TSI_MONTH, (TIMESTAMPDIFF (SQL_TSI_MONTH, 'Employee'. "" Date of hire ".

    VALUEOF (CURRENT_DT))), "employee." ("" Date of hire ")

    what you are aiming for using above? Why you should add and subtract?

    Made with this

  • selection of the week, month, year in source throgh odi 11g?

    Hello

    I have 3 years of data in a source table (tableatm). data will be added to this table eod.

    img2.jpg

    I applied the filter on the column atm_date below screenshot

    Based on the filter, I want to load the data of the year underway, data of the current month data of the week underway, data from the previous month, data from the previous week, data from the previous year to this table.

    If I want to load data for 2010, then filter applied on TO_CHAR (TABLEATM. ATM_DATE, 'YYYY') = '2010' , I get only the data of 2010.

    If want to download data from 2015, filter applied on TO_CHAR (TABLEATM. ATM_DATE, 'YYYY') = "2015". But it's constant...

    I want to give the filter like that.

    TO_CHAR (TABLEATM. (ATM_DATE, «YYYY») = double '(sélectionnez (sysdate,-12)) ". When I applied the filter using this formula on this date column. I don't get all the data.

    Please help me...

    img1.jpg

    Please help me,

    Thanks in advance,

    A.Kavya.

    Hello

    I applied the dynamic filter as shown below. now, I get only the data of the year 2015...

    filter condition is

    TO_CHAR (to_number (to_char (TABLEATM. ATM_DATE, "YYYY"))) = (SELECT to_char (to_number (to_char (SYSDATE, 'YYYY'))-1)

    THE DOUBLE)

    Thanks & regards,

    A.Kavya.

  • get the number of the day of the week - any national locale is used

    Hi all

    My need is to get the number of the day of the week - any national local is used.

    For example, Saturday's 6th day of the week in my country, because the week starts on Monday.

    I heard that some countries start the week of Sunday.

    So my need is to compile code that does not depend on local national.

    How can I make it?

    Oracle Database 11 g Enterprise Edition Release 11.2.0.1.0 - 64 bit Production

    PL/SQL Release 11.2.0.1.0 - Production

    "CORE 11.2.0.1.0 Production."

    AMT for Linux: Version 11.2.0.1.0 - Production

    NLSRTL Version 11.2.0.1.0 - Production

    Hello

    2621671 wrote:

    Hi all

    My need is to get the number of the day of the week - any national local is used.

    For example, Saturday's 6th day of the week in my country, because the week starts on Monday.

    ...

    That's what you asked for, whatever your NLS settings:

    1 + TRUNC (dt) - TRUNC (dt, 'IW')

    If dt is a DATE, TRUNC (dt, 'IW') is the beginning of the ISO week containing dt.  ISO weeks always start on Monday, whatever NLS_TERRITORY, or other NLS parameters.

    I heard that some countries start the week of Sunday.

    So my need is to compile code that does not depend on local national.

    How can I make it?

  • get the number of days of the week to sysdate

    Hi all

    my need is to get the number of the day of the week of sysdate.

    Here's how can I make it right now:

    Select to_char(sysdate,'Dy') t1 double

    But he returns the abbreviated name of the day of the week while I need number of days of the week.

    Please help me. Thanks in advance.

    Best regards

    --

    Marco

    Or if you want the ISO week (Monday = day 1):

    Select trunc (sysdate) - trunc(sysdate,'IW') + 1 double;

  • How to calculate the number of days/weeks/months between 2 dates?

    Hello

    I would like to know how to calculate the number of days/weeks/months between 2 dates in OBIEE 11 g, for example, I have 26/05/2013 and 19/05/2013, then I want to get 7 days.

    Thank you!
    Jamie

    Hi Jamie,

    Through this links...

    http://www.bravesoft.com/blog/?p=682
    http://twobiee.blogspot.in/2012/01/working-with-date-differences.html

    Mark as correct it allows u...
    Thank you...

  • You will need to add the number of days to the end date of the users.

    Hello
    I have a code where we adding the number of days (30) to the current date and update IDM DB user end date.
    Now, we have a requirement to add the number of days (30) to the existing fence of user instead of add to the current date.

    * public String incrementDate (int daysToAdd)
    {
    Start date
    log.info("NotifyLastDayOfService::incrementDate(): entrez»);
    SimpleDateFormat sdf = new SimpleDateFormat ("yyyy-MM-DD 00:00:00");
    Calendar c = Calendar.GetInstance ();
    c.Add (Calendar.DATE, daysToAdd); number of days to add
    String PROMOTIONDate = sdf.format (c.getTime ());
    log.info("NotifyLastDayOfService::incrementDate(): sortie»);
    return Nouvelle_date;
    }*/

    Have any body set up this scenario?
    Please suggest.


    Thank you
    Kalpana.

    You can try this as well

    where oimAttribute = "Users.End Date"

    public String updateOIMAttributeForDateType (String oimAttribute, Date endDate, long take, String daysToAdd)
    {
    tcUserOperationsIntf userOperationsIntf = null;
    HashMap modifyMap = new HashMap ();
    HashMap searchmap = new HashMap ();
    SimpleDateFormat formatter = new SimpleDateFormat ("yyyy-MM-DD hh: mm :"); ")
              
    try {}
    Calander cal = null;
    cal.setTime (endDate);
    Cal.Add (Calendar.DATE, Integer.parseInt (daysToAdd));
    Date Edate = cal.getTime ();

    modifyMap.put (oimAttribute, Edate);
    searchmap.put ("Users.Key", String.valueOf (take));
    userOperationsIntf = Platform.getService (tcUserOperationsIntf.class);
    tcResultSet searchset = (searchmap) userOperationsIntf.findAllUsers;
    userOperationsIntf.updateUser (searchset, modifyMap);
    return a SUCCESS;
    } catch (Exception e) {}
    If (Logger.isErrorEnabled ()) logger.error (e.getMessage ());
    error return;
    } {Finally
    try {}
    If (userOperationsIntf! = null) userOperationsIntf.close ();
    } catch (Exception e) {if (logger.isErrorEnabled ()) logger.error (e.getMessage ()) ;}}
    }

  • Get number of days of the week to a month

    Hi, someone can tell me how to get the number of working days per month, or the number of days other than Saturdays and Sundays

    Well, others and I already posted an example of use of sysdate?

    Maybe you need to take a look at this again.

    Just trunc sysdate to month: trunc (sysdate, 'mm') = 06/01/2009
    Take the start of the next month less a day: trunc (add_months (sysdate, 1), 'mm')-1 = 30-06-2009 (or use last_day)

    Use a connection level, count the days without the Treaty, and there you go...

  • Number of days in the Horizontal Plan of equipment

    HI Expert...

    Why in Horizontal material Plan (MRP) only have 36 number of days?

    Everything is set up to add days in this form?

    Thank you

    The Pooh

    Hello

    Planning MRP has a maximum display of 36 columns/buckets.

    You can consult the MOS Notes

    1 MRPSCPWB Horizontal plane: Is there a setting or a profile to allow users to see beyond 36 buckets? (Doc ID 396416.1)

    2 MRPSCPWB - Workbench Plan Horizontal planners: Y at - it a setting or a profile to allow users to see beyond 36 buckets (days, weeks, periods)? (Doc ID 743132.1)

    Concerning

  • Appointments that occur every day of the week

    Why the Q9h only allows you to choose an appointment if you start on a Monday, 16 November, to Occur: 'Once', 'Every Monday', ' Day 16th of each month "and" each Nov 16 "and that's it?".  I want an appointment occur all the working days and is not a choice.  I can set up this type of appointment in OUTLOOK, but after a week or two it just stops working on my phone.  Is the only alternative to the 5 appointments, one for each day of the week, or can change you the "Periodicity" field to add "Every day of work" in the options?  If this isn't the case, it would be a great addition to the new update when it is published.

    Synchronize you with Outlook? I put all mine up there and Blackberry Connect syncs to phone "over the air".  I have an alarm software that will allow the establishment of an unlimited number of detectors that are recurring, Chronos by ActiveKitten Software

Maybe you are looking for

  • Not good at El Capitan Snow Leopard: which goes back?

    Well, I'm in trouble, I think. I have improved my Early 2008 iMac (2.4 Ghz 4 GB ram) machine of 10.6 Snow Leopard to El Capitan (reason: so I could save my new iPhone6s - was not recognized in iTunes in 10.6). What is OS El Capitan somewhere cool, bu

  • HP 15-r001Sia: can not find the drivers

    My computer has been affected by the virus and new windows have been installed, but failled to get all the drivers and I can't use the other parts of the computer for example I can't connect USB flash, unable to connect to wifi and blue tooth. It say

  • I get the same update to install

    It is security update for xml core services 4.0 microsoft service pack 2 (KB954430)Why is this happening, he says it has installed, I installed it for like a month now, please help

  • Error update Firmware on PS-100F Array

    Hi team, I have two paintings PS-100F. I've updated a table 3.3.1 in 4.0.7 using ftp and serial cable. However I'm unable to update the second table. I can copy the .tgz OK: it is an ls: FTP > lsCommand PORT 200 successful.150 opening ASCII mode conn

  • Information to TextArea html WebView

    Hello Can pass information to TextArea html WebView? IAM using Html WebView can show body or any element of HTML for a TextArea? Webview{ id: myweb html: ' Hrllo (:. ' } Textarea{ id: mytext text: myweb.html } When using this work, but show him all t