Date Format - Calculate Overdue Days

Hi Friends,
We have downloaded the Customer Statement in excel and want to verify the overdue days by comparing the 'Document Date' and the 'Net Due Date' as per the payment terms. However, after we download the Customer Statement and put the formula for deducting the Document Date from the Net Due Date, the formula gives an error "#Value!", We are trying to change the date format which is in dots, but are unable to do so.
Can anyone help as to how can we do this?
Thanks for the help.
Regards

Hello,
I do not know why are you doing this exercise in EXCEL, when SAP has provided ready-made solution for this?
Execute FBL5N - Open items
Change Layout (Ctrl+F8)
Select "Arrears after net due date".
Just for your information: Overdue date are the difference between the "Current Date" and "Net Due Date", but NOT "Document Date" and "Net Due Date".
Out of SAP Scope:
If you want to find out the number of days between two dates then
A1 = 31/10/2008
A2 = 29/12/2008
A3 = Formulae = DAYS360(A1,A2)
Please make sure that the values in cells A1 and A2 are in DD/MM/YYYY (valid date format)
Hope this will help you.
Thanks,
Ravi

Similar Messages

  • 7.4.00070 Ticket date format showing as day of the year ie 191-jul-15

    http://community.spiceworks.com/help/Date_Time_Formatting?utm_campaign=app_help&utm_medium=app&a...
    SW help on the topic.

    There is an issue in the latest version where it is sowing the day of the year instead of the day of the month. I have tried changing it via setting to dd-mm-yyyy but nothing happens
    This topic first appeared in the Spiceworks Community

  • Formscentral - how do I change required date format to long date (e.g. January 2, 2014) in a form field?

    Formscentral - how do I change required date format to long date (e.g. January 2, 2014) in a form field?  I can't seem to change it from the short date format.

    Hi,
    I would suggest you to change the form language to English (UK), Here are the steps:-
    1. Open your form in FormsCentral
    2. Clik on Options tab
    3. Click on Language and Formatting and check out the selection for Form Language and make sure English (U.K.) is selected and the default date format should be day/month/year.
    Regards,
    Nakul

  • Date format in different from System Preferences

    The date display in the top right corner of the menu bar is not according to the custom setting I have defined in System Preferences.
    In Language & Region, I defined the date format to be <day of month number> < name of month> <year>.
    The menu bar however displays the date in American style date format of <name of month> <day of months number>.
    Is there any way to have Numbers pick up the date format from Language & Region as defined in System Preferences?

    The date display in the top right corner of the menu bar is not according to the custom setting I have defined in System Preferences.
    In Language & Region, I defined the date format to be <day of month number> < name of month> <year>.
    The menu bar however displays the date in American style date format of <name of month> <day of months number>.
    Is there any way to have Numbers pick up the date format from Language & Region as defined in System Preferences?

  • Conversion of Date format(0bill_date) to no of days format

    We have a report "customer payment analysis report" with following fields
    Customer No        ,   Customer Name        ,  Customer Group  ,     Payment Term       ,      Actual Paid Days,          Difference
    In the cube we are having  0bill_date(actual paid date) ,but want to convert this 0bill_date(in date format) to Actual paid days( no of days format).
    How to get that?
    Edited by: ranamk on Jan 13, 2011 8:06 AM

    Hi,
    Count the number of paid dates. It will give you the number of actual paid days
    Thanks,
    Dinesh

  • How to convert Date format into day in ssrs reports?

    Hi
    How to convert date format into day?
    10/01/2010 as like Monday like that?

    =weekdayname(datepart("w",Fields!mydate.Value))
    -Vaibhav Chaudhari

  • Date format in mail - "yesterday, the day before,..."

    Hello.
    When using mail in the new version, the left gutter gathering all the inboxes, each message summary displays the essentials infos.
    In many cases the date display is set to show the reception hour on the same day (fine), the previous day is shown as "yesterday" and the day before yesterday as "the day-before-yesterday", and finally "two days ago".
    My system is in french thus it's not written" two days ago" but (I translate) "before-before-yesterday".... This doesn't help me anymore.
    Here is my question: is there a way to set the date format in the message short in order to have the full numerical date as soon as "yesterday", actually to always have a numerical date display ... no more "avant-avant-hier".
    Thanks

    Thanks but...
    I just sort of just figured out the obvious and noticed, that I'd even have a big problem if that regex of mine worked.... unluckily, there actually seem to be days with a number smaller than 3, but no negative days in the human calendar... so I'm going to rest first and think it over after that. Most likely I'm going to end up subtracting a day in unix-time and converting back, better ideas are not necessary but welcome .
    (edit: oh, and thanks again - that might come handy when I ended up with the same $(\[chaos\]) trying the unix time version later)
    Last edited by whoops (2009-08-25 18:29:30)

  • "D2008178" - FM to calculate the date of the x day in a year

    Hi all!
    I am looking for a FM to calculate the date of a certain day in the year.
    For example which date has the day 178 of the year.
    This has nothing to do with the factory calendar!!!
    Thanks a lot for your help
    CU
    Peter

    Hi Peter,
    Please check this funtion module "FIMA_DATE_CREATE".
    Sample code as follows:
    REPORT  ztest_vinay.
    DATA: w_date TYPE vtbbewe-dvalut.
    PARAMETERS: p_date TYPE vtbbewe-dvalut.
    CALL FUNCTION 'FIMA_DATE_CREATE'
      EXPORTING
        i_date                        = p_date  " Here you need to pass first day of the year
        i_calendar_days         = 178
    IMPORTING
        e_date                        = w_date.
    WRITE: w_date.
    Regards,
    Vinay
    Edited by: Vinay Kumar Amruth on Feb 18, 2009 2:52 PM
    Edited by: Vinay Kumar Amruth on Feb 18, 2009 3:01 PM

  • Date Formatting - Day and Month Switching Places

    I am starting to get really frustrated with this problem; at first it was just a nuisance, but now when I actually want and need to do something important with Numbers it has become a major headache.
    When I first select a formatting and enter a date it works fine. I enter, e.g., "1 Aug 2009" and Numbers formats it "1 August, 2009" as per my formatting selection. However, when I go to change the formatting to, e.g., "day of week, day month, year" my "1 August 2009" suddenly becomes "Thursday, 8 January, 2009" - it switches the day and month values around! This happens no matter which format I choose, and no matter what I do - whether I enter the day first or month first, American or European - it always switches them around when I go to change the format. It's infuriating!
    Does anyone have any suggestions? What am I to do?

    Welcome to Apple Discussions
    I believe the problem is that you have US formats for dates. Select the cells/columns that you want your date format to apply to then click the cell format inspector (the 42 in a box icon) & choose Custom… from the cell format drop-down. You will be presented with a box that allows you to make your own format. Click & hold on any of the little "lozenges" in the input bar & move them around. You may need to add a space to get the proper result.

  • How to calculate the days with a date field

    I need to make a query that shows the number of flown days at the end of the month for the whole fleet, given a date that represents one day within that month.
    I would appreciate all the help I can get
    thanks in advance

    Hi,
    I am not sure if I interpreted your question correctly, but are you looking for counting for number of days between two days?
    If yes, see if the following example query helps you.
    SQL>select to_date('30-Jun-2003') - to_date('30-May-2003') from dual
    - this returns 31.
    If not, could you please give more details of your requirement with an example?
    -Savitha.

  • How can I calculate a day of a week?

    I want to calculate a day of a week.But I always getting ArraysOutOfBoundException.Here's my code:
    import java.util.*;
    import javax.swing.*;
    class daydate{
         public static void main(String args[])throws Exception
         String arr[]={
              "satarday","sunday","monday","tuesday","wednesday","thursday","friday"
    String output="",op="",m,m1,m2;
         Calendar calendar=Calendar.getInstance();
         int i=calendar.get(Calendar.DAY_OF_WEEK);
    /*if(i>6)
         i=i-7;*/
    // System.out.println(i);
         output+="\ntoday is :"+arr[i]+"\n";
         JOptionPane.showMessageDialog(null,output,"day",JOptionPane.INFORMATION_MESSAGE);
         m=JOptionPane.showInputDialog("Enter year.");
         int n=Integer.parseInt(m);
    m1=JOptionPane.showInputDialog("Enter month.");
         int n1=Integer.parseInt(m1);
         m2=JOptionPane.showInputDialog("Enter date.");
         int n2=Integer.parseInt(m2);
    calendar.set(n,n1,n2);
    int j=calendar.get(Calendar.DAY_OF_WEEK);
    /*if(j>6)
    j=j-7;*/
    //System.out.println(j);
    op+="\nthat day is/was :"+arr[j]+"\n";
         JOptionPane.showMessageDialog(null,op,"day",JOptionPane.INFORMATION_MESSAGE);
    System.exit(0);
    the error is:
    Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 7
         at CalculateDay.main(CalculateDay.java:28)
    I wonder using calendar.get(Calendar.DAY_OF_WEEK) makes the value of i=7;But my array's highest value is 6.That's why I always get the above error.
    How can I solve that?

    I think the DAY_OF_WEEK is working from 1 to 7, and
    Saturday, on my PC (UK GregorianCalendar) is 7. Your
    array is based 0, and only work from (0-6).
    Either subtract 1 from the value DAY_OF_WEEK, or add
    a blank item at the beginning of the list.
    Better, I think is used the built-in capability using
    public String getDate(String format){
    Calendar c = new GregorianCalendar();
    Date d = cal.getTime();
    DateFormat df = new SimpleDateFormat(format);
    return df.format(d);
    You can then call the getDate() with various formats
    ie.
    getDate("EEE") alone to get "Wed, Thur" .. etc
    getDate("dd/MM/yyyy HH:mm:ss") to get the current
    Date and time in that format.
    Hope it helps.Thanks William for your valuable help.Anyway,you wrote,
    Date d=cal.getTime();
    Is it cal or c?

  • Date Format in calculations

    Hi all,
    we are currently upgrading our discoverer from version 3.1.25 to version 10.2.0.1.0.
    we have an old report that had been created with the old version and saved on the computer (not in the database) with a date calculation on a date parameter as follows: <table_name>.<date_field> - :DATEPARAMETER (the date format of the two dates values is DD/MM/YYYY).
    This calculation works fine on the old discoverer version when we run it, but when we try to run the report on the new discoverer desktop version (10.2.0.1.0) we get an error that the parameter is incorrect.
    the thing is that if i convert the date format manually using the to_date function on the parameter, it works fine.
    My question is what is the default date format for the calculations, and how can i set it myself?
    i already added the NLS_DATE_FORMAT key in the registry under HKEY_LOCAL_MACHINE -> SOFTWARE -> ORACLE, but it doesn't work, it changes the date format of the date fields that are presented in the table after a report execution.
    In addition, if we save the report to the database using the desktop version and try to run the report on discoverer plus, we get the same error and need to perform the same solution (convert the parameter manually with to_date).

    mac-a-rooney wrote:
    I am working with dates.
    1st I want to calculate a time span for example calculate cell A2 - cell A1. In cell A1 it is written 01.01.2010 (so first of January) and in cell A2 01.02.2010 (so first of February). I wrote the dates in letters, too, to avoid misunderstandings due to different national date formats.
    Since January has 31 days, the obvious result thereof is "31D". So far so good.
    but now I want to multiply the 31 with a numeric value, but not the 31D, because if I do so, and let's say the numeric value is 3, then my result is 93 DAYS rather than just 93.
    Are you sure you're asking in the right forum?
    Using Numbers '08, with the following entries:
    B2: Jan 1, 2010
    C2: Feb 1,2010
    D2: =C2-B2
    E2: =3*D2
    I get 31 (not 31D) in D2 and 93 (not 93 DAYS) in D2.
    From your description, I think you're actually using Numbers '09, and Jerry's advice above applies.
    Regards,
    Barry

  • How to validate date formate YYYY-MM-DDThh:mm:ss ?

    i have implemented validation for YYYY-MM-DD <br>
    but how to validate for time <br>
    here is the code for date validation
    could you please anyone help me on this issue
    <br><br><br> public static boolean validateDateFormate(String date) <br><br>
    {   <br>
    <br>      try {   <br>          
    <br>     String dateFormat="yyyy-MM-ddYYYY-MM-DDThh:mm:ss";
    <br>     String temp = date.substring(0,date.indexOf("-"));
    <br>     if(temp.length()!= 4)
    <br>          return false;           
    <br>     SimpleDateFormat df=new SimpleDateFormat(dateFormat);      
    <br>     Date date1=df.parse(date);
         <br>String resultDateString=df.format(date1);
         <br>System.out.println("date1"+resultDateString);
         <br> if ( !date.equals(resultDateString)) { return false;  }
    <br>     } catch (Exception de) {
         <br>     System.out.println(de);
    <br>          return false;
         <br>     
         <br>}
    <br>     return true;
    <br> }

    A useful Data util class
    import java.text.DateFormat;
    import java.util.Calendar;
    import java.util.Date;
    import java.util.StringTokenizer;
    public final class SlacDate implements Comparable
         public final static int FormatDDMMCCYY               = 0;
         public final static int FormatMMDDCCYY               = 1;
         public final static int FormatDATETIME               = 2;
         public final static int FormatMMMDDTIME               = 3;
         public final static int FormatTIMESTAMP               = 4;
         public final static int FormatCCYYMMDD               = 5;
         public final static int FormatCCYYMMDDHHMM          = 6;
         public final static int FormatCCYYMMDDHHMMSS     = 7;
         public final static int FormatDDMMCCYYTIME          = 8;
         public final static int FormatDATEVERBOSE          = 9;
         public final static int FormatDATETIMEVERBOSE     = 10;
         public final static int FormatHHMMSS               = 11;
         public final static int FormatHHMMSSMIL               = 12;
         public final static int FormatDB2TIMESTAMP          = 13;
         public final static int FormatUDBTIMESTAMP          = 14;
         public final static int JANUARY          = 1;
         public final static int FEBRUARY     = 2;
         public final static int MARCH          = 3;
         public final static int APRIL          = 4;
         public final static int MAY               = 5;
         public final static int JUNE          = 6;
         public final static int JULY          = 7;
         public final static int AUGUST          = 8;
         public final static int SEPTEMBER     = 9;
         public final static int OCTOBER          = 10;
         public final static int NOVEMBER     = 11;
         public final static int DECEMBER     = 12;
         public final static int MONTHS_IN_YEAR = 12;
         public final static int SUNDAY          = 1;
         public final static int MONDAY          = 2;
         public final static int TUESDAY          = 3;
         public final static int WEDNESDAY     = 4;
         public final static int THURSDAY     = 5;
         public final static int FRIDAY          = 6;
         public final static int SATURDAY     = 7;
         public final static int DAYS_IN_WEEK = 7;
         private final static int DefaultHours   = 12;
         private final static int DefaultMinutes = 0;
         private final static int DefaultSeconds = 0;
         private final static int DefaultMillis     = 0;
         private final static int DaysInMonth[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
         private final static String MonthAbbrev[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
         private final static String MonthVerbose[] = { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" };
         private final static String DaysOfWeekAbbrev[] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };
         private final static String DaysOfWeek[] = { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" };
         private final static String DayExtension[] = { "th", "st", "nd", "rd", "th", "th", "th", "th", "th", "th" };
         private final static String EMPTY = "";
         private final static String COLON = ":";
         private final static String PERIOD = ".";
         private final static String HYPHEN = "-";
         private final static String SPACE = " ";
         private final static String ZERO  = "0";
         private static String s_dateSep = HYPHEN;
         private int m_dd, m_mm, m_yyyy, m_hh, m_min, m_ss, m_mil;
         private static long MillisInSecond     = 1000;
         private static long MillisInMinute     = MillisInSecond * 60;
         private static long MillisInHour     = MillisInMinute * 60;
         private static long MillisInDay          = MillisInHour * 24;
          * JDK_BST_FIX
          * Static initialisation block - check JDK vendor/version in order to determine whether
          * an adjustment to correctly report British summertime needs to be made. This is required
          * in order to fix a bug in some Sun & IBM JDKs. If an untested version of the Sun or IBM JDK
          * is used, we log an error message warning that this block of code should be examained and
          * changed as appropriate. This is ugly, but will prevent a new JDK being used and this bug
          * creeping back in.
          * Note the following JDKs have been tested under both NT & AIX
          *    JDK Version           NT          AIX
          *          1.1.7 (IBM)          x          x
          *          1.1.7A (IBM)               ?
          *          1.1.7B (IBM)     ?          ?
          *          1.1.8 (IBM)          x          x
          *          1.2.2 (IBM)          ok          ok
          *          1.1.7 (SUN)          x          x
          *          1.1.8 (SUN)          x          x
          *          1.2 (SUN)          x          x
         private final static String SunVendorString = "Sun Microsystems Inc.";
         private final static String IBMVendorString = "IBM"; // Can also be 'IBM Corporation'
         private final static String SunProblemJDKs[] = { "1.1.4", "1.1.5", "1.1.6", "1.1.7", "1.1.7A", "1.1.7B", "1.1.8", "1.2", "1.2.2" };
         private final static String     SunOKJDKs[] = { "1.0.2", "1.1.2", "1.1.3", "1.4.0", "1.4.2"};
         private final static String IBMProblemJDKs[] = { "1.1.4", "1.1.5", "1.1.6", "1.1.7", "1.1.7A", "1.1.8" };
         private final static String     IBMOKJDKs[] = { "1.0.2", "1.1.2", "1.1.3", "1.1.7B", "1.2.2", "1.3.0", "1.3.1" };
         private static boolean s_adjustForBST = false;
         static
              String vendor = System.getProperty("java.vendor");
              String jdk = System.getProperty("java.version");
              // Check applies to Sun only.
              if (vendor.equals(SunVendorString) || vendor.startsWith(IBMVendorString))
                   String problemJDKs[] = null;
                   String OKJDKs[] = null;
                   if (vendor.equals(SunVendorString))
                        problemJDKs = SunProblemJDKs;
                        OKJDKs = SunOKJDKs;
                   else
                        problemJDKs = IBMProblemJDKs;
                        OKJDKs = IBMOKJDKs;
                   // Determine whether we need to make adjustment
                   for (int i = 0; i < problemJDKs.length; i++)
                        if (problemJDKs.equals(jdk))
                             s_adjustForBST = true;
                             break;
                   // If we do not need to make the adjustment then check that the
                   // JDK reported is one of the versions that we know to be good.
                   // If it is not log an error message.
                   if (!s_adjustForBST)
                        boolean goodJDK = false;
                        for (int i = 0; i < OKJDKs.length; i++)
                             if (OKJDKs[i].equals(jdk))
                                  goodJDK = true;
                                  break;
    /* CR176 - we now anticipate that all JDKs post 1.3.x are "good" ones
                        if (!goodJDK)
                             // We do not use the SingletonLogger mechanism since we
                             // cannot be sure that these singleton objects have been instantiated
                             // at this point, and in any case it is not desirable to introduce
                             // this dependancy into SlacDate.
                             System.err.println("JDK VERSION ERROR : Unsupported JDK - '" + jdk + "' provided by '" + vendor + "'. SlacDate class requires examination.");
         * Construct the date with todays date.
         * <p>This should be the only place where a Date object is explicitly instantiated. All
         * other code should use SlacDate. If the s_adjustForBST flag is set and the date falls
         * between the last sunday of March and the last Sunday of October (inclusive) then we need
         * to make an adjustment of +1 hour so that British Summertime is correctly reported.
         private SlacDate()
              init(Calendar.getInstance());
         * Construct the date with the specified day, month and year.
         * @param year The year to set the date to
         * @param month The month to set the date to
         * @param date The date to set the date to
         * @exception InvalidDateException Invalid date parameters passed in.
         public SlacDate(int year, int month, int date) throws InvalidDateException
              init(year, month, date, DefaultHours, DefaultMinutes, DefaultSeconds, DefaultMillis);
         * Construct the date with the specified day, month, year, hour and minute.
         * @param year The year to set the date to
         * @param month The month to set the date to
         * @param date The date to set the date to
         * @param hr The hour to set the date to
         * @param min The minute to set the date to
         * @exception InvalidDateException Invalid date parameters passed in.
         public SlacDate(int year, int month, int date, int hr, int min) throws InvalidDateException
              init(year, month, date, hr, min, DefaultSeconds, DefaultMillis);
         * Construct the date with the specified day, month, year, hour, minute and second.
         * Will default to 0 milliseconds.
         * @param year The year to set the date to
         * @param month The month to set the date to
         * @param date The date to set the date to
         * @param hr The hour to set the date to
         * @param min The minute to set the date to
         * @param sec The second to set the date to
         * @exception InvalidDateException Invalid date parameters passed in.
         public SlacDate(int year, int month, int date, int hr, int min, int sec) throws InvalidDateException
              init(year, month, date, hr, min, sec, DefaultMillis);
         * Construct the date with the specified day, month, year, hour, minute, second and milliseconds.
         * @param year The year to set the date to
         * @param month The month to set the date to
         * @param date The date to set the date to
         * @param hr The hour to set the date to
         * @param min The minute to set the date to
         * @param sec The second to set the date to
         * @param millis The milliseconds to set the date to
         * @exception InvalidDateException Invalid date parameters passed in.
         public SlacDate(int year, int month, int date, int hr, int min, int sec, int millis) throws InvalidDateException
              init(year, month, date, hr, min, sec, millis);
         * Construct the date from a timestamp.
         public SlacDate(long timestamp) throws InvalidDateException
              Calendar cal = Calendar.getInstance();
              cal.setTime(new Date(timestamp));
              init(cal);
         * Construct the date from the specified string. Note that the date must
         * be in day/month/year format.
         * @param date The date string.
         * @exception InvalidDateException The date passed in is invalid.
         public SlacDate(String date) throws InvalidDateException
              init(date);
         * Construct the date from the specified string. The format passed in will
         * identify the format of the date.
         * @param date The date string.
         * @param format The format of the date.
         * @exception InvalidDateException The date passed in is invalid.
         public SlacDate(String date, int format) throws InvalidDateException
              if (format == FormatCCYYMMDD || format == FormatCCYYMMDDHHMM || format == FormatCCYYMMDDHHMMSS)
                   boolean valid = false;
                   date = date.trim();
                   if (date.length() >= 8)
                        try
                             int year = Integer.parseInt(date.substring(0,4));
                             int month = Integer.parseInt(date.substring(4,6));
                             int day = Integer.parseInt(date.substring(6,8));
                             int hour;
                             int min;
                             int sec;
                             if (date.length() > 8)
                                  hour = Integer.parseInt(date.substring(8,10));
                                  min = Integer.parseInt(date.substring(10,12));
                                  if (date.length() >= 14)
                                       sec = Integer.parseInt(date.substring(12,14));
                                  else
                                       sec = DefaultSeconds;
                             else
                                  hour = DefaultHours;
                                  min = DefaultMinutes;
                                  sec = DefaultSeconds;
                             init(year, month, day, hour, min, sec, DefaultMillis);
                             valid = true;
                        catch (Exception e)
                   if (!valid)
                        throw new InvalidDateException("Invalid date: " + date + " for the specified format");
              else if (format == FormatDB2TIMESTAMP || format == FormatUDBTIMESTAMP)
                   // 2002-02-04 10:49:30.999000 (UDB)
                   // 2002-02-04-10.49.30.999000 (DB2)
                   int year = Integer.parseInt(date.substring(0,4));
                   int month = Integer.parseInt(date.substring(5,7));
                   int day = Integer.parseInt(date.substring(8,10));
                   int hour = Integer.parseInt(date.substring(11,13));
                   int min = Integer.parseInt(date.substring(14,16));
                   int sec = Integer.parseInt(date.substring(17,19));
                   int millis = Integer.parseInt(date.substring(20,23));
                   init(year, month, day, hour, min, sec, millis);
              else
                   init(date);
         * Construct the date with the java.util.Date passed in.
         public SlacDate(Date date)
              init(date);
         * Init the date with the java.util.Date passed in.
         private void init(Date date)
              Calendar cal = Calendar.getInstance();
              cal.setTime(date);
              init(cal);
         * Return whether this date is after the date passed in.
         * @d2 The date to compare against.
         * @return Whether this date is after the date passed in.
         public boolean after(SlacDate d2)
              int xx = d2.getYear();
              if (m_yyyy > xx)
                   return true;
              else if (m_yyyy < xx)
                   return false;
              else
                   xx = d2.getMonth();
                   if (m_mm > xx)
                        return true;
                   else if (m_mm < xx)
                        return false;
                   else
                        xx = d2.getDate();
                        if (m_dd > xx)
                             return true;
                        else if (m_dd < xx)
                             return false;
                        else
                             xx = d2.getHour();
                             if (m_hh > xx)
                                  return true;
                             else if (m_hh < xx)
                                  return false;
                             else
                                  xx = d2.getMinute();
                                  if (m_min > xx)
                                       return true;
                                  else if (m_min < xx)
                                       return false;
                                  else
                                       xx = d2.getSecond();
                                       if (m_ss > xx)
                                            return true;
                                       else if (m_ss < xx)
                                            return false;
                                       else
                                            return (m_mil > d2.getMillisecond());
         private void appendHoursMinutes(StringBuffer str, String separator)
              if (m_hh < 10)
                   str.append(ZERO);
              str.append(Integer.toString(m_hh));
              if (!separator.equals(EMPTY))
                   str.append(separator);
              if (m_min < 10)
                   str.append(ZERO);
              str.append(Integer.toString(m_min));
         private void appendTime(StringBuffer str, String separator, boolean addMillis)
              appendHoursMinutes(str, separator);
              if (!separator.equals(EMPTY))
                   str.append(separator);
              if (m_ss < 10)
                   str.append(ZERO);
              str.append(Integer.toString(m_ss));
              if (addMillis)
                   if (!separator.equals(EMPTY))
                        str.append(separator);
                   if (m_mil < 100)
                        str.append(ZERO);
                        if (m_mil < 10)
                             str.append(ZERO);
                   str.append(m_mil);
         * Version of the asString() method which defaults to FormatDDMMCCYY.
         * <p>An example date in this format is:
         * <pre>
         * 25-02-1999
         * </pre>
         * @return The Date as a string in DDMMCCYY format.
         public String asString()
              return asString(FormatDDMMCCYY);
         * Convert the date to a String. This will format the Date as defined by the format
         * passed in. The default parameter is FormatDDMMCCYY.
         * The valid formats are:
         * <ul>
         * <li>FormatDDMMCCYY</li>
         * <li>FormatMMDDCCYY</li>
         * <li>FormatDATETIME</li>
         * <li>FormatDDMMTIME</li>
         * <li>FormatTIMESTAMP</li>
         * <li>FormatCCYYMMDD</li>
         * <li>FormatCCYYMMDDHHMM</li>
         * <li>FormatCCYYMMDDHHMMSS</li>
         * <li>FormatDDMMCCYYTIME</li>
         * <li>FormatDATEVERBOSE</li>
         * <li>FormatDATETIMEVERBOSE</li>
         * <li>FormatHHMMSS</li>
         * <li>FormatHHMMSSMIL</li>
         * <li>FormatDB2TIMESTAMP</li>
         * <li>FormatUDBTIMESTAMP</li>
         * </ul>
         * @param format The format to return the string in.
         * @return The date in string format (as specified by the format parameter).
         public String asString(int format)
              StringBuffer str = new StringBuffer(20);
              if (format == FormatDB2TIMESTAMP || format == FormatUDBTIMESTAMP)
                   str.append(Integer.toString(getYear()));
                   str.append(HYPHEN);
                   int month = getMonth();
                   if (month < 10)
                        str.append(ZERO);
                   str.append(Integer.toString(month));
                   str.append(HYPHEN);
                   int day = getDate();
                   if (day < 10)
                        str.append(ZERO);
                   str.append(Integer.toString(day));
                   String dateTimeSeparator = new String();
                   if (format == FormatDB2TIMESTAMP)
                        dateTimeSeparator = HYPHEN;
                   else if (format == FormatUDBTIMESTAMP)
                        dateTimeSeparator = SPACE;
                   str.append(dateTimeSeparator);
                   String timeSeparator = new String();
                   if (format == FormatDB2TIMESTAMP)
                        timeSeparator = PERIOD;
                   else if (format == FormatUDBTIMESTAMP)
                        timeSeparator = COLON;
                   appendTime(str, timeSeparator, true);
                   str.append("000");
              else if (format == FormatDATETIME || format == FormatMMMDDTIME || format == FormatTIMESTAMP)
                   str.append(getMonthNameAbbrev());
                   str.append(SPACE);
                   if (m_dd < 10)
                        str.append(ZERO);
                   str.append(Integer.toString(m_dd));
                   str.append(SPACE);
                   appendTime(str, COLON, false);
                   if (format == FormatDATETIME)
                        str.append(SPACE);
                        str.append(Integer.toString(m_yyyy));
                   else if (format == FormatTIMESTAMP)
                        str.append(COLON);
                        str.append(formattedMillis(m_mil));
              else if (format == FormatHHMMSS)
                   appendTime(str, COLON, false);
              else if (format == FormatHHMMSSMIL)
                   appendTime(str, COLON, true);
              else if (format == FormatCCYYMMDD || format == FormatCCYYMMDDHHMM || format == FormatCCYYMMDDHHMMSS)
                   str.append(Integer.toString(m_yyyy));
                   if (m_mm < 10)
                        str.append(ZERO);
                   str.append(Integer.toString(m_mm));
                   if (m_dd < 10)
                        str.append(ZERO);
                   str.append(Integer.toString(m_dd));
                   if (format == FormatCCYYMMDDHHMMSS)
                        appendTime(str, EMPTY, false);
                   else if (format == FormatCCYYMMDDHHMM)
                        appendHoursMinutes(str, EMPTY);
              else if (format == FormatDATEVERBOSE || format == FormatDATETIMEVERBOSE)
                   str.append(Integer.toString(m_dd));
                   if (m_dd > 10 && m_dd < 14)
                        str.append(DayExtension[0]);
                   else
                        str.append(DayExtension[m_dd%10]);
                   str.append(SPACE);
                   str.append(getMonthName());
                   str.append(SPACE);
                   str.append(Integer.toString(m_yyyy));
                   if (format == FormatDATETIMEVERBOSE)
                        str.append(",");
                        str.append(SPACE);
                        appendTime(str, COLON, false);
              else
                   // DDMMCCYY, MMDDCCYY, DDMMCCYYTIME
                   int first;
                   int second;
                   if (format != FormatMMDDCCYY)
                        first = getDate();
                        second = getMonth();
                   else
                        second = getDate();
                        first = getMonth();
                   if (first < 10)
                        str.append(ZERO);
                   str.append(Integer.toString(first));
                   str.append(s_dateSep);
                   if (second < 10)
                        str.append(ZERO);
                   str.append(Integer.toString(second));
                   str.append(s_dateSep);
                   str.append(Integer.toString(getYear()));
                   if (format == FormatDDMMCCYYTIME)
                        str.append(SPACE);
                        appendTime(str, COLON, false);
              return str.toString();
         * Return whether this date is before the date passed in
         * @d2 The date to compare against.
         * @return Whether this date is before the date passed in.
         public boolean before(SlacDate d2)
              return (!after(d2) && !equals(d2));
         * Clone the current date.
         * @return The cloned SlacDate object
         public Object clone()
              SlacDate d = new SlacDate();
              d.m_dd          = m_dd;
              d.m_mm          = m_mm;
              d.m_yyyy     = m_yyyy;
              d.m_hh          = m_hh;
              d.m_min          = m_min;
              d.m_ss          = m_ss;
              d.m_mil          = m_mil;
              return d;
         * Compare this date with the supplied date.
         * Hours, minutes, seconds and milliseconds are taken into consideration.
         * Returns:
         *      -1 this date is before the supplied date.
         *      0 this date is equal to the supplied date.
         *      1 this date is after the supplied date.
         public int compareTo(Object o2)
              SlacDate d2 = (SlacDate)o2;
              if (equals(d2))
                   return 0;
              if (after(d2))
                   return 1;
              return -1;
         * Compare this date with the supplied date.
         * Hours, minutes, seconds and milliseconds are NOT taken into consideration.
         * Returns:
         *      -1 this date is before the supplied date.
         *      0 this date is equal to the supplied date.
         *      1 this date is after the supplied date.
         public int compareDate(Object o2)
              SlacDate baseDate = (SlacDate)o2;
              SlacDate startBaseDate = new SlacDate(baseDate.getCalendar().getTime());
              startBaseDate.setHour(0);
              startBaseDate.setMinute(0);
              startBaseDate.setSecond(0);
              startBaseDate.setMillisecond(0);
              SlacDate endBaseDate = new SlacDate(baseDate.getCalendar().getTime());
              endBaseDate.setHour(23);
              endBaseDate.setMinute(59);
              endBaseDate.setSecond(59);
              endBaseDate.setMillisecond(999);
              int compare = 0;
              if (before(startBaseDate))
                   compare = -1;
              else if (after(endBaseDate))
                   compare = 1;
              return compare;
         * Compare this date with today's date.
         * Hours, minutes, seconds and milliseconds are NOT taken into consideration.
         * Returns:
         *      -1 this date is before today.
         *      0 this date is equal to today.
         *      1 this date is after today.
         public int compareToToday()
              return compareDate(today());
         * Calculate the difference (in days) between the two dates.
         * Note the difference may be negative.
         * @param from The <i>start</i> date
         * @param to The <i>to</i> date
         * @return The difference between the dates in days.
         public static int daysBetween(SlacDate from, SlacDate to)
              int dayFrom;
              int     monthFrom;
              int yrFrom;
              int dayTo;
              int     monthTo;
              int yrTo;
              int mult = 1;
              if (from.after(to))
                   mult=-1;
                   dayFrom          = to.getDate();
                   monthFrom     = to.getMonth();
                   yrFrom          = to.getYear();
                   dayTo          = from.getDate();
                   monthTo          = from.getMonth();
                   yrTo          = from.getYear();
              else
                   dayFrom          = from.getDate();
                   monthFrom     = from.getMonth();
                   yrFrom          = from.getYear();
                   dayTo          = to.getDate();
                   monthTo          = to.getMonth();
                   yrTo          = to.getYear();
              int cnt=0;
              try
                   if (yrFrom != yrTo)
                        // Different Years.
                        for (int i=yrFrom+1; i<yrTo; i++)
                             cnt += SlacDate.daysInYear(i);
                        for (int i=monthFrom+1; i<13; i++)
                             cnt+=daysInMonth(i, yrFrom);
                        for (int i=1; i<monthTo; i++)
                             cnt+=daysInMonth(i, yrTo);
                        cnt += (daysInMonth(monthFrom, yrFrom)-dayFrom);
                        cnt += dayTo;
                   else
                        if (monthFrom != monthTo)
                             // Same Year but different months.
                             for (int i=monthFrom+1; i<monthTo; i++)
                                  cnt+=daysInMonth(i, yrFrom);
                             cnt += (daysInMonth(monthFrom, yrFrom)-dayFrom);
                             cnt += dayTo;
                        else
                             // Same Year and month.
                             cnt += (dayTo-dayFrom);
              catch (InvalidDateException ide)
                   // This should never happen
              return cnt * mult;
         * Calculate the number of days from the specified date.
         * Note the difference may be negative.
         * @param date The date to calculate from
         * @return The diference between the two dates in days (may be negative).
         public int daysFrom(SlacDate date)
              return daysBetween(date, this);
         * Calculates the number of days in a given month in a given year
         * copes with century dates!
         * @param month The month to determine the day count
         * @param year The year the month is in (only relevant for February).
         * @exception InvalidDateException Invalid parameters passed in. Ie the month was >= 12
         *                    or the month was < 0.
         public static int daysInMonth(int month, int year) throws InvalidDateException
              if (month > 12 || month <= 0)
                   throw new InvalidDateException("Invalid month specified to SlacDate.daysInMonth(): " + month);
              // month-1, because DaysInMonth array is 0-based.
              return (month == FEBRUARY && isLeapYear(year)) ? 29 : DaysInMonth[month-1];
         * Calculates the number of days in a given year.
         * @param year The year the month is in (only relevant for February).
         public static int daysInYear(int year)
              return (isLeapYear(year)) ? 365 : 364;
         * Calculate the number of days to the specified date.
         * Note the difference may be negative.
         * @param date The date to calculate to
         * @return The diference between the two dates in days (may be negative).
         public int daysTo(SlacDate date)
              return daysBetween(this, date);
         * Decrement the date by the specified number of years, months and days.
         * @param years The number of years to increment by
         * @param months The number of months to increment by
         * @param days The number of days to increment by
         public void decrement(int years, int months, int days)
              decrementYears(years);
              decrementMonths(months);
              decrementDays(days);
         * Decrement the date by the specified number of days.
         * @param days The number of days to decrement by
         public void decrementDays(int days)
              incrementDays(days * -1);
         * Decrement the date by the specified number of hours.
         * @param hours The number of hours to decrement by
         public void decrementHours(int hours)
              incrementHours(hours * -1);
         * Decrement the date by the specified number of milliseconds.
         * @param seconds The number of seconds to decrement by
         public void decrementMilliseconds(int milliseconds)
              incrementMilliseconds(milliseconds * -1);
         * Decrement the date by the specified number of minutes.
         * @param minutes The number of minutes to decrement by
         public void decrementMinutes(int minutes)
              incrementMinutes(minutes * -1);
         * Decrement the date by the specified number of months.
         * @param years The number of months to decrement by
         public void decrementMonths(int months)
              incrementMonths(months * -1);
         * Decrement the date by the specified number of seconds.
         * @param seconds The number of seconds to decrement by
         public void decrementSeconds(int seconds)
              incrementSeconds(seconds * -1);
         * Decrement the date by the specified number of years.
         * @param years The number of years to decrement by
         public void decrementYears(int years)
              incrementYears(years * -1);
         * Calculate the difference between two dates to the nearest second as a String.
         * @param from The start date
         * @param to The end date
         public static String differenceBetween(SlacDate from, SlacDate to)
              SlacDate f, t;
              if (from.after(to))
                   t = from;
                   f = to;
              else
                   t = to;
                   f = from;
              int secs = 0;
              int mins = 0;
              int hours = 0;
              int days = 0;
              int months = 0;
              int years = 0;
              secs     = t.getSecond() - f.getSecond();
              mins     = t.getMinute() - f.getMinute();
              hours     = t.getHour() - f.getHour();
              days     = t.getDate() - f.getDate();
              months     = t.getMonth() - f.getMonth();
              years     = t.getYear() - f.getYear();
              if (secs < 0)
                   secs += 60;
                   mins--;
              if (mins < 0)
                   mins += 60;
                   hours--;
              if (hours < 0)
                   hours += 24;
                   days--;
              if (days < 0)
                   try
                        days += daysInMonth(f.getMonth(), f.getYear());
                   catch (InvalidDateException ide)
                        days += 30;
                   months--;
              if (months < 0)
                   months += 12;
                   years--;
              StringBuffer sb = new StringBuffer();
              sb.append(years).append(s_dateSep);
              sb.append(months).append(s_dateSep);
              sb.append(days).append(SPACE);
              sb.append(hours).append(COLON);
              sb.append(mins).append(COLON);
              sb.append(secs);
              return sb.toString();
         * Calculate the difference between the date passed in and this date.
         * Note that if the date passed in is in the future the difference will be
         * negative.
         * @param from The date from which to return the difference
         * @return The difference from the date passed in in String format
         public String differenceFrom(SlacDate from)
              return differenceBetween(from, this);
         * Calculate the difference between this date and the one passed in.
         * Note that if the date passed in is in the past the difference will be
         * negative.
         * @param to The date to which to return the difference
         * @return The difference to the date passed in in String format
         public String differenceTo(SlacDate to)
              return differenceBetween(this, to);
         * Return whether the two dates are the same. This will check right down to the second.
         * @param d2 The date to compare against
         * @return Whether the dates are the same.
         public boolean equals(SlacDate d2)
              return ((m_yyyy == d2.m_yyyy) &&
                        (m_mm == d2.m_mm) &&
                        (m_dd == d2.m_dd) &&
                        (m_hh == d2.m_hh) &&
                        (m_min == d2.m_min) &&
                        (m_ss == d2.m_ss) &&
                        (m_mil == d2.m_mil));
         public String format(DateFormat df)
              Calendar cal = getCalendar();
              return df.format(cal.getTime());
         private final String formattedMillis(int millis)
              String rString = null;
              if (millis < 10)
                   rString = "00" + millis;
              else if (millis < 100)
                   rString = ZERO + millis;
              else
                   rString = EMPTY + millis;
              return rString;
         public Calendar getCalendar()
              Calendar cal = Calendar.getInstance();
              cal.set(m_yyyy, m_mm-1, m_dd, m_hh, m_min, m_ss);
              cal.set(Calendar.MILLISECOND, m_mil);
              return cal;
         * Return the Date/Time in CCYYMMDD format.
         * <p>An example date in this format is:
         * <pre>
         * 19990225
         * </pre>
         * @return The Date as a string in CCYYMMDD format.
         public String getCCYYMMDD()
              return asString(FormatCCYYMMDD);
         * Return the Date/Time in CCYYMMDDHHMM format.
         * <p>An example date in this format is:
         * <pre>
         * 199902251423
         * </pre>
         * @return The Date as a string in CCYYMMDDHHMM format.
         public String getCCYYMMDDHHMM()
              return asString(FormatCCYYMMDDHHMM);
         * Return the Date/Time in CCYYMMDDHHMMSS format.
         * <p>An example date in this format is:
         * <pre>
         * 19990225142356
         * </pre>
         * @return The Date as a string in CCYYMMDDHHMMSS format.
         public String getCCYYMMDDHHMMSS()
              return asString(FormatCCYYMMDDHHMMSS);
         public int getDate()     { return m_dd; }
         * Return the date in DATETIME format.
         * <p>An example date in this format is:
         * <pre>
         * Feb 25 14:21:09 1999
         * </pre>
         * @return The Date as a string in DATETIME format.
         public String getDATETIME()
              return asString(FormatDATETIME);
         * Return the Date/Time in DATETIMEVERBOSE format.
         * <p>An example date in this format is:
         * <pre>
         * 25th February 1999, 14:21:09
         * </pre>
         * @return The Date as a string in DATETIMEVERBOSE format.
         public String getDATETIMEVERBOSE()
              return asString(FormatDATETIMEVERBOSE);
         * Return the Date/Time in DATEVERBOSE format.
         * <p>An example date in this format is:
         * <pre>
         * 25th February 1999
         * </pre>
         * @return The Date as a string in DATEVERBOSE format.
         public String getDATEVERBOSE()
              return asString(FormatDATEVERBOSE);
         * Return the day o

  • Create unique Form ID - Help on Date Format in Concat

    I am having problems formating a date value in my concat statement.  I have tried to write is different ways and still can't seem to get the string correct.
    Ideally, I would like to change the date value to a Julian value for the form ID, but I would settle for just mmddyy value without the / or - in between.
    Codes I have tried w/out date format string
    JavaScript - Calculate
    Program.FormID.rawValue=Program.State.rawValue + Program.ProgramNumber.rawValue + Program.ProgramDate.formattedValue;
    Returns - MO1234Jul8,2010  
    -------------And--------------------
    Program.FormID.rawValue=Program.State.rawValue + Program.ProgramNumber.rawValue + Program.ProgramDate.rawValue;
    Returns - MO12342010-07-08
    FormCalc - Calculate 
    (This one has the current date as a value, but it changes the unique form ID when reopened on another day, that is why I am using ProgramDate)
    Concat(Date2Num(Date(), "ddmmyyy"),Program.State.rawValue, Program.ProgramNumber.rawValue)
    Returns - 0MO1234
    ----------- And --------------------
    if 
    (Program.ProgramNumber.rawValue ne null) then
    $.rawValue
    = CONCAT(Program.State.rawValue, Program.ProgramNumber.rawValue, Program.ProgramDate.formattedValue)
    else
    $.rawValue = ""
    endif 
    Returns - MO1234July8,2010  (formattedValue)
                  MO12342010-07-08 (rawValue)
    What would be the better  language to use, FormCalc or JavaScript for this example?
    I am not all that skilled at coding and use forums like this to help me, so I appreciate any help.
    Thanks in advance - Eve

    Date.prototype.yyyymmdd = function() {
       var yyyy = this.getFullYear().toString();
       var mm = (this.getMonth()+1).toString(); // getMonth() is zero-based
       var dd  = this.getDate().toString();
       return yyyy + (mm[1]?mm:"0"+mm[0]) + (dd[1]?dd:"0"+dd[0]); // padding
    Now, after having spliced the internal Date object, you can do this:
    d = new Date();
    d.yyyymmdd();
    The line above returns today's date: "20100709".

  • Result of Multiplying a Date formated Cell

    I have recently started using Numbers and having trouble with the date and format options.  I am trying to calculate the number of days between two dates and then multiplying the result by a value. 
    I have been able to format the to and from dates using the date format.  The result is given in days.  When I multiply this day cell by a value the result is given in days and I want it to be the value
    Can anyone help
    Regards
    Arthur

    Arthur,
    I'm sorry about your disappointment. Numbers is a capable spreadsheet program that differs from Excel in some ways and has fewer features, but also has some unique features. Nothing about your problem statement is difficult in Numbers and there is nothing that you will learn in a phone call to Apple that we can't help you with here.
    Anytime you begin using a new piece of software you must expect to invest an hour or two in reading the user guide, at least the first couple of chapters. This is important even if you do eventually go to an Apple tutor. It's important to know the terminology and the basics as they are presented out in the User Guide, available for download from the Help menu.
    Here is an example of your exact problem statement, with as much accuracy as is possible with the amount of detail you provided:
    Date 1 is in Column A, Date 2 is in Column B and the difference is in Column C. This difference in Column C is in the units of Duration, in this case the result "5d" is a duration of 5 days. Column D converts this duration to a pure numeric value. Column E does the multipliation. Of course you could collapse all that calculation business into one cell. The one cell version would be: =DUR2DAYS(B-A)*5.5
    Regards,
    Jerry

Maybe you are looking for

  • If statement for calculated column

    Hi, I need to know if its possible to do the following in a calculated column if column1 value => 1 display the name of column1 + the value of column 1 is this possible?

  • New Macbook + 320gb WD = Problem

    Hi, i just got the new macbook 2ghz and bought a 320gb WD 5400/min hard drive. It works just fine except for the fact that it makes a sound every 5 - 30sec when the hdd is not in use. "clack" ... 5 sec ... "clack" ... 30 sec ... "clack" ... 10 sec ..

  • Cant delete backups or sync

    I have been having some problems for some time now with not being able to sync my idevice. I have done tons of serching with no luck, I read that i should delete my back ups under edit, prefrences, devices. But when I delete them they come right back

  • Other Free themes

    Does anyone know of any sites where I can download some more themes. I have come across some that you can buy but not any free.

  • Possible to remove 2:3 pulldown in Premiere Pro CC?

    Hi, I've mistakenly recorded footage on a Canon C100 at PF24 rather than 24p. I'm trying to use the PF24 footage (which is in a 60i wrapper) on a 24 fps (23.976) timeline in Premiere Pro.  Is there a way to properly interpret the footage w/in Premier