Converting Time Values to Decimal

My timesheet at work (currently on Excel but I'd like to move to Numbers) lets me record start and finish times as hours and minutes but allows me to convert the total to fractions of an hour. For example, 1 hour 15 minutes converts to 1.25 hours. This lets me enter the details on the company database timesheet, which works in that format. I'm sure I'm being thick but I've checked through the manuals and can't find out how to convert. How do I do it?

Here is an oldfashioned formula:
=(TIMEVALUE(C)-TIMEVALUE(B))*24
which may be used with numbers '08 as well as with Numbers '09.
If you are sure that your doc will never be exported to Numbers '08 you may use:
=DUR2HOURS(C-B)
Yvan KOENIG (VALLAURIS, France) mardi 23 mars 2010 15:15:35

Similar Messages

  • Converting Time format to Decimal Value

    Dear All,
    How to convert time to decimal value for substraction of time and decimal value
    for eg l_time type tims
           l_dec type p.
    l_diff = l_time - l_dec
    Kindly let me know.
    Thanks in Advacne,
    Ranjan

    Hi,
    Try like this...
    PARAMETERS : tim TYPE tims,
                 y TYPE p.
    DATA : t TYPE string,
           t1 TYPE string,
           t2 TYPE string,
           t3 TYPE string.
    START-OF-SELECTION.
      t = tim(2).
      t  = t * 3600. " hours to second
      t1 = tim+2(2).
      t1 = t1 * 60.  " minutes to second
      t2 = tim+4(2).
      t3 = t + t1 + t2. " total time in second
      t3 = t3 - y.
    Regards
    Debarshi

  • Convert Voltage values to Decimal values.

    I need to convert voltage values/range to decimal values/range.
    Example: I read voltage (range 0 to 1.0volts) form DAC and covert it corresponding decimal value (decimal value range is 0 to 16000).
    0 decimal = 0 volts
    16000 decimal = 1.0volts.
    Thanks for the help.

    I'm not sure how you'd get a value of 16000 out of the 2620 as that is only a 12-bit DAC that will produce values from 0 to 4095. Here's the transfer function directly copied from page 12 of Linear's datasheet.
    Charles Chickering
    Architecture is art with rules.
    ...and the rules are more like guidelines
    Attachments:
    TransferFunction.JPG ‏17 KB

  • Decimal format time value to convert into time (hr:min:sec)value in a graph

    I need to develop a graph in WAD, in BW7. In the graph the value must be showed as HR:MIN:SEC, which I cannot get it right.
    The keyfigure value  carries the duration(hr:min:sec) in decimal format.  In the query, I use this keyfigure for calculation. To get the time broadcasted for a week range. I get the total duration (say 507835.000). Now I need to convert this value back to hr:min:sec. I use the below formulas to get the hr, min, sec.
    D = 507835
    Val1 = D/3600
    Val2 = Frac(val1)
    Val3 = Val2 * 60
    Val4 = frac(Val3) * 60
    Hr = Val1 – Val2
    Min =  Val3 – frac(Val3)
    Sec =  Val4
    In another formula in the query I add Hr + Min/100 + Sec/10000 to get hr.minsec format.
    When I do an average on count of weeks,  this doesn’t round off correctly.
    I tried to also use the Data function TIME() which when the time is > 24 hrs changes the value.
    Lets say if it is 39:00:00, it shows value as 15:00:00 instead of keeping the value 39:00:00.
    When I used this value in the graph it did not show the HR:MIN:SEC values in the value axis instead  it showed 0.0, 0.1,….1.0. Bcoz of this the graph is blank.
    Can anybody help me to resolve this problem.
    Thanks alot
    Anima

    I checked SU01 and didn't see anything there to customize...
    In my workstation, control panel / regional and languages settings / tab regional Options / customize; my time format is HH:mm:ss; the HH has to be in capital letter to display the time in 24 hour...
    but this is strange anyway... are you reporting with web frontend or excel?

  • Convert millisecond time value to date

    If i have a millisecond time value, say long timeValue, how do I convert this value to a time and a date?

    Or directly set a new date using the constructor
    Date(long date)
    Allocates a Date object and initializes it to represent the specified number of milliseconds since the standard base time known as "the epoch", namely January 1, 1970, 00:00:00 GMT.
    N.B. - Note that the Date class method to set a date from a long is:
    setTime(long time)
    Sets this Date object to represent a point in time that is time milliseconds after January 1, 1970 00:00:00 GMT.
    setTimeInMillis() is a Calendar method , only.

  • Convert field value from Double to Date Time.

    Hi Every one.  Its been a long time since i have last posted on this site but i need some help again please.
    I want to convert a field value (saved as format double) to a date time value. I dont seem to find a function
    that can do this can anyone give me some help please?
    A sample would be to convert 40249.6588697106 to the format of Date Time being 12/03/2010 15:48:46
    Any suggestion?
    Thanks

    You can define a date time variable and use CDateTime.
    dim d as DateTime
    d = CDateTime(40179.55833333)
    formula = d

  • How could I choose some bytes from HEX string and then convert it to a decimal value?

    Hi I am working with an OMRON E5EN temperature controller using VISA serial to get data, I send the Read from Variable Area command and get this string  in hexa 0230 3130 3030 3030 3130 3130 3030 3030 3030 3030 3041 3203 71 or .01000001010000000000A2.q in ASCII this string means:
    02 STX
    3031 3030 Node and subadress
    3030 End Code Normal Completion
    3031 3031 Command Read from Variable Area
    3030 3030 respt code Normal completion
    3030 3030 3030 4132 Hexadecimal A2 = 162  (this is the temperature data that I want to show in decimal)
    03 ETX
    71 Block Check Character
    I want to choose the eight bytes for the temperature data and convert it to a decimal number. I have seen the examples to convert a Hexa string to decimal but I do not know how to choose the specifics bytes that I need.
    I have look for a driver but i didn´t find any. I am a beginner so please include especific topics for me to study in your answer.
    Thanks
    Carlos Fuentes Silva Queretaro Mexico 

    If the response always has the temperature starting with byte 15 and is always 8 bytes in length, you can use the String Subset function to get those bytes out of the string.  Then use Hex String to Number to convert to a decimal number.
    Well someone already beat me to the solution:
    Message Edited by tbob on 01-04-2008 04:42 PM
    - tbob
    Inventor of the WORM Global
    Attachments:
    HexStr2Decimal.png ‏7 KB

  • Using COUNTIF on time values in pop-up menu (employee schedule template)

    I have modified the Numbers employee schedule template to my liking and it works very well. I would like to add a column to the beginning which shows, at a glance, how many people I have scheduled for AM shifts and PM shifts on a given day. My AM shifts start at 9:00 AM and my PM shifts end at 6:30 or 8:30 PM.
    So I thought I could use COUNTIF, but after I set the array, I cannot get the condition right to return anything except "0". How do you make it detect the appropriate times? The times in each cell for In and Out times are selected using a pop-up menu, just like the template.
    Here is what I tried: =COUNTIF(E3:AE3,"9:00 AM")
    What should the condition be to return a proper count?

    ac,
    You shouldn't feel badly about having trouble with this template. It is a rather tricky one. The values in the Pop-Up menus are Date/Time values. That is to say, they have year, month, day, hour and minute components, even if only the hours and minutes are displayed. So if you only compare to the hours and minutes, you will never get a match.
    I don't know if you have experienced this yet, but when you changed the Pop-Up menu content, you probably entered the current year, month and day unknowingly and will have trouble doing math against the Pop-Up content that was originally in the template.
    My suggestion in your case would be to convert the time references to decimal hours before doing a comparison. For instance, if the time you wish to compare to is in cell C4, you could extract the decimal hours with =HOUR(C4)+MINUTE(C4)/60
    Remember that the hours will reflect a 24-hour day, so times in the afternoon will run from 12.0 to 23.99...
    Then after converting to decimal, instead of using "9:00 AM" for the COUNTIF criteria, use 9.
    There are probably ways to do this using the Duration format as well, but I prefer the decimal hours.
    Hope this helps.
    Jerry

  • How to substract two date&time values

    Well,i just need to substract last visited date&time value from systemdate. The last visited date&time(from the filed named SONBULUNMAZAMANI, ) is selected from table (IHALE_KATILIMCILAR ) in the format DD-MM-RRRR HH24:MI and systemdate is in the same format. And i need to get value in minutes. Then i need to check if the value is greater then 20 minutes, finally i will update database and set IHALE_KATILIMCILAR.AKTIF=0. Here is the code i used;
    DECLARE
    MinDiff number;
    DateTime1 ihale_katilimcilar.sonbulunmazamani%TYPE;
    BEGIN
    select t.sonbulunmazamani into DateTime1 from ihale_katilimcilar t where t.ihlkodu=141 and t.ihlaltktgkodu=132 and t.id_iliski=193;
    MinDiff := ABS( TO_DATE( TO_CHAR(SYSDATE, 'DD-MM-RRRR') || TO_CHAR(SYSDATE , 'HH24:MI'), 'DD-MM-RRRR HH24:MI' ) - TO_DATE( TO_CHAR(DateTime1, 'DD-MM-RRRR') || TO_CHAR(DateTime1, 'HH24:MI'), 'DD-MM-RRRR HH24:MI' ) );
    DBMS_OUTPUT.PUT_LINE('Difference is ' || MinDiff);
    END;
    However the result i get is always pointed values such as ,1895833333333333333333333333333333333333. How can i handle this?
    And here is the scripts of table:
    create table IHALE_KATILIMCILAR
    KULADI VARCHAR2(20),
    SONUC NUMBER(1),
    AKTIF NUMBER(1) default 1,
    SRKTKODU VARCHAR2(10) not null,
    SONBULUNMAZAMANI DATE default sysdate,
    SIRA NUMBER(1) default 0,
    MESAJ VARCHAR2(200),
    ID NUMBER(6) not null,
    IHLKODU NUMBER not null,
    IHLALTKTGKODU VARCHAR2(10) not null,
    ID_ILISKI NUMBER,
    IHLSIRA NUMBER(1) default 0,
    CEVAP VARCHAR2(200)
    insert into IHALE_KATILIMCILAR (KULADI, SONUC, AKTIF, SRKTKODU, SONBULUNMAZAMANI, SIRA, MESAJ, ID, IHLKODU,
    IHLALTKTGKODU, ID_ILISKI, IHLSIRA, CEVAP)
    values ('asd', null, 1, '4444', to_date('19-02-2008 10:29:44', 'dd-mm-yyyy hh24:mi:ss'), 0, 'süre talep 2', 76, 145,
    '135', 345, 0, 'al sna süre 77');
    insert into IHALE_KATILIMCILAR (KULADI, SONUC, AKTIF, SRKTKODU, SONBULUNMAZAMANI, SIRA, MESAJ, ID, IHLKODU,
    IHLALTKTGKODU, ID_ILISKI, IHLSIRA, CEVAP)
    values ('asd', null, 1, '4444', to_date('20-02-2008 14:49:52', 'dd-mm-yyyy hh24:mi:ss'), 0, null, 77, 145, '135',
    345, 0, null);
    insert into IHALE_KATILIMCILAR (KULADI, SONUC, AKTIF, SRKTKODU, SONBULUNMAZAMANI, SIRA, MESAJ, ID, IHLKODU,
    IHLALTKTGKODU, ID_ILISKI, IHLSIRA, CEVAP)
    values ('asd', null, 1, '4444', to_date('19-02-2008 10:29:44', 'dd-mm-yyyy hh24:mi:ss'), 0, null, 78, 145, '135',
    345, 0, null);
    insert into IHALE_KATILIMCILAR (KULADI, SONUC, AKTIF, SRKTKODU, SONBULUNMAZAMANI, SIRA, MESAJ, ID, IHLKODU,
    IHLALTKTGKODU, ID_ILISKI, IHLSIRA, CEVAP)
    values ('asd', null, 1, '4444', to_date('19-02-2008 10:29:44', 'dd-mm-yyyy hh24:mi:ss'), 0, null, 79, 145, '135',
    345, 0, null);
    insert into IHALE_KATILIMCILAR (KULADI, SONUC, AKTIF, SRKTKODU, SONBULUNMAZAMANI, SIRA, MESAJ, ID, IHLKODU,
    IHLALTKTGKODU, ID_ILISKI, IHLSIRA, CEVAP)
    values ('KEMMM', null, 0, '42', to_date('17-03-2008 09:29:20', 'dd-mm-yyyy hh24:mi:ss'), 0, null, 63, 141, '134',
    191, 0, null);
    insert into IHALE_KATILIMCILAR (KULADI, SONUC, AKTIF, SRKTKODU, SONBULUNMAZAMANI, SIRA, MESAJ, ID, IHLKODU,
    IHLALTKTGKODU, ID_ILISKI, IHLSIRA, CEVAP)
    values ('MLK', null, 1, '46', to_date('07-03-2008 09:52:20', 'dd-mm-yyyy hh24:mi:ss'), 0, null, 64, 141, '134', 192,
    0, null);
    insert into IHALE_KATILIMCILAR (KULADI, SONUC, AKTIF, SRKTKODU, SONBULUNMAZAMANI, SIRA, MESAJ, ID, IHLKODU,
    IHLALTKTGKODU, ID_ILISKI, IHLSIRA, CEVAP)
    values ('KEM.ESM', null, 1, '44', to_date('06-03-2008 13:28:50', 'dd-mm-yyyy hh24:mi:ss'), 0, null, 61, 145, '135',
    189, 0, null);
    insert into IHALE_KATILIMCILAR (KULADI, SONUC, AKTIF, SRKTKODU, SONBULUNMAZAMANI, SIRA, MESAJ, ID, IHLKODU,
    IHLALTKTGKODU, ID_ILISKI, IHLSIRA, CEVAP)
    values ('KE.ES', null, 1, '45', to_date('07-03-2008 11:16:41', 'dd-mm-yyyy hh24:mi:ss'), 0, null, 69, 141, '133',
    197, 0, null);
    insert into IHALE_KATILIMCILAR (KULADI, SONUC, AKTIF, SRKTKODU, SONBULUNMAZAMANI, SIRA, MESAJ, ID, IHLKODU,
    IHLALTKTGKODU, ID_ILISKI, IHLSIRA, CEVAP)
    values ('KEMMM', null, 0, '42', to_date('17-03-2008 09:29:20', 'dd-mm-yyyy hh24:mi:ss'), 0, null, 65, 141, '132',
    193, 1, null);
    insert into IHALE_KATILIMCILAR (KULADI, SONUC, AKTIF, SRKTKODU, SONBULUNMAZAMANI, SIRA, MESAJ, ID, IHLKODU,
    IHLALTKTGKODU, ID_ILISKI, IHLSIRA, CEVAP)
    values ('KE.ES', null, 1, '45', to_date('07-03-2008 11:16:41', 'dd-mm-yyyy hh24:mi:ss'), 2, null, 66, 141, '132',
    194, 1, null);
    insert into IHALE_KATILIMCILAR (KULADI, SONUC, AKTIF, SRKTKODU, SONBULUNMAZAMANI, SIRA, MESAJ, ID, IHLKODU,
    IHLALTKTGKODU, ID_ILISKI, IHLSIRA, CEVAP)
    values ('MLK', null, 1, '46', to_date('07-03-2008 09:52:20', 'dd-mm-yyyy hh24:mi:ss'), 0, null, 67, 141, '132', 195,
    1, null);
    insert into IHALE_KATILIMCILAR (KULADI, SONUC, AKTIF, SRKTKODU, SONBULUNMAZAMANI, SIRA, MESAJ, ID, IHLKODU,
    IHLALTKTGKODU, ID_ILISKI, IHLSIRA, CEVAP)
    values ('KEMMM', null, 0, '42', to_date('17-03-2008 09:29:20', 'dd-mm-yyyy hh24:mi:ss'), 0, null, 68, 141, '133',
    196, 0, null);
    insert into IHALE_KATILIMCILAR (KULADI, SONUC, AKTIF, SRKTKODU, SONBULUNMAZAMANI, SIRA, MESAJ, ID, IHLKODU,
    IHLALTKTGKODU, ID_ILISKI, IHLSIRA, CEVAP)
    values ('KEM.ESM', null, 1, '44', to_date('12-03-2008 15:00:58', 'dd-mm-yyyy hh24:mi:ss'), 0, null, 70, 142, '252',
    198, 1, null);
    insert into IHALE_KATILIMCILAR (KULADI, SONUC, AKTIF, SRKTKODU, SONBULUNMAZAMANI, SIRA, MESAJ, ID, IHLKODU,
    IHLALTKTGKODU, ID_ILISKI, IHLSIRA, CEVAP)
    values ('KE.ES', null, 1, '45', to_date('10-03-2008 10:08:17', 'dd-mm-yyyy hh24:mi:ss'), 0, null, 71, 142, '252',
    199, 1, null);
    insert into IHALE_KATILIMCILAR (KULADI, SONUC, AKTIF, SRKTKODU, SONBULUNMAZAMANI, SIRA, MESAJ, ID, IHLKODU,
    IHLALTKTGKODU, ID_ILISKI, IHLSIRA, CEVAP)
    values ('KEM.ESM', null, 1, '44', to_date('10-03-2008 10:08:56', 'dd-mm-yyyy hh24:mi:ss'), 0, null, 72, 143, '253',
    200, 1, null);
    insert into IHALE_KATILIMCILAR (KULADI, SONUC, AKTIF, SRKTKODU, SONBULUNMAZAMANI, SIRA, MESAJ, ID, IHLKODU,
    IHLALTKTGKODU, ID_ILISKI, IHLSIRA, CEVAP)
    values ('MLK', null, 1, '46', to_date('12-02-2008 13:34:40', 'dd-mm-yyyy hh24:mi:ss'), 0, null, 73, 143, '253', 201,
    1, null);
    insert into IHALE_KATILIMCILAR (KULADI, SONUC, AKTIF, SRKTKODU, SONBULUNMAZAMANI, SIRA, MESAJ, ID, IHLKODU,
    IHLALTKTGKODU, ID_ILISKI, IHLSIRA, CEVAP)
    values ('KE.ES', null, 1, '45', to_date('06-03-2008 14:09:40', 'dd-mm-yyyy hh24:mi:ss'), 0, null, 60, 145, '136',
    188, 1, null);
    insert into IHALE_KATILIMCILAR (KULADI, SONUC, AKTIF, SRKTKODU, SONBULUNMAZAMANI, SIRA, MESAJ, ID, IHLKODU,
    IHLALTKTGKODU, ID_ILISKI, IHLSIRA, CEVAP)
    values ('KEM.ESM', null, 1, '44', to_date('06-03-2008 13:28:50', 'dd-mm-yyyy hh24:mi:ss'), 0, null, 74, 145, '136',
    202, 1, null);
    insert into IHALE_KATILIMCILAR (KULADI, SONUC, AKTIF, SRKTKODU, SONBULUNMAZAMANI, SIRA, MESAJ, ID, IHLKODU,
    IHLALTKTGKODU, ID_ILISKI, IHLSIRA, CEVAP)
    values ('KE.ES', null, 1, '45', to_date('06-03-2008 14:09:40', 'dd-mm-yyyy hh24:mi:ss'), 0, null, 75, 145, '135',
    203, 0, null);
    Thanks...

    What version of SQLServer do you have? Datediff is not an Oracle built-in function.
    OP:
    THe difference between two dates in Oracle is in days. The decimal portion refers to partial days, so you need to convert that to the required precision. Also, both sysdate and your column are date type, and contain a time portion, so you do not need all the to_date/to_char stuff. Something like:
    SQL> SELECT end_dt, start_dt, (end_dt - start_dt) * 24*60 diff
      2  FROM (SELECT sysdate end_dt, TRUNC(sysdate) start_dt
      3        FROM dual);
    END_DT             START_DT                 DIFF
    17-mar-08 10:39:39 17-mar-08 00:00:00     639.65John

  • What you wanted to know about Time values

    Hello
    I tried to gather in a single document the useful infos about the use of time values in Numbers.
    I must thanks pw1840 which checked the English syntax.
    Here is the text only document.
    Files with the sample tables are available on my iDisk:
    <http://idisk.me.com/koenigyvan-Public?view=web>
    Download:
    ForiWork:ForNumbers:Time in Numbers.zip
    *STORED DATE-TIME VALUES - BASICS*
    Numbers clearly states that it stores date-time values, no less no more. This means these values consist of two parts: a date and a time. It is important to note that both parts are present even if only one of them is displayed.
    When we type the time portion only, it includes the current date even though it may not be displayed.
    But when we apply the formula: =TIME(0,0,ROUND(TIMEVALUE(B)24*6060,0)), we get a date-time value whose numerical value of the date portion is 0. This means, in AppleLand, 1 janvier 1904. Such a date-time allows us to make correct calculations, but there are two true drawbacks:
    1) Since TIMEVALUE() returns a decimal number, when we calculate the corresponding number of seconds we MUST use the ROUND() function. While calculations with decimal numbers give the wanted value, they may not be exact and be off by + or - epsilon. And
    2) The structure of Numbers date-time values is such that the time part is always in the range 0:00:00 thru 23:59:59.
    There is also a detail which seems annoying to some users. The minimal time unit is the second because time values are in fact a pseudo string representing the number of seconds between the date-time and the base date-time, 1 janvier 1904 00:00:00.
    -+-+-+-+-
    *TIMEVALUE() FUNCTION*
    When Numbers Help states that the TIMEVALUE() function "converts a date, a time, or a text string to a decimal fraction of a 24-hour day.", it means that the operand for the function TIMEVALUE() may be something like:
    31/12/1943, 31 décembre 1943, or 31 déc. 1943 described as a date;
    1:12:36 or 1:12 described as time; or
    31/12/1943 23:59:59 described as a text string.
    The date may also be 31/12/43 but here the program must guess the century. According to the rule, this one will be 31/12/2043 (yes, I am very young).
    All of this is not exactly what we are accustomed to but it is perfectly logical as described. My guess is that those who don't understand are simply clinging to old habits and are reluctant to adopt an unfamiliar approach .
    -+-+-+-+-
    *ELAPSED TIME (DURATION)*
    Given a table whose 1st row is a header, I will assume that column B stores starting-time values and column C stores ending-time values. Both do not display the date component of the date-time values. We may get the difference in column D with the formula:
    =IF(OR(ISBLANK(B),ISBLANK(C)),"",TIMEVALUE(C)-TIMEVALUE(B))
    which returns the elapsed time as the decimal part of the day.
    We immediately encounter a problem. If ending-time is the day after the starting-day, the result will be negative. So it would be useful to revise the formula this way:
    =IF(OR(ISBLANK(B),ISBLANK(C)),"",IF(TIMEVALUE(C)>TIMEVALUE(B),0,1)+TIMEVALUE(C) -TIMEVALUE(B))
    But some of us may wish to see results in the traditional format which may be achieved using:
    =IF(OR(ISBLANK(B),ISBLANK(C)),"",TIME(0,0,ROUND((IF(TIMEVALUE(C)>TIMEVALUE(B),0 ,1)+TIMEVALUE(C)-TIMEVALUE(B))24*6060,0)))
    -+-+-+-+-
    *DURATION SUMS > or = 24 HOURS*
    In the examples above, we always assumed that the durations where smaller than 24 hours because Numbers states clearly in the Help and the PDF Users Guide that time values are restricted to the range 00:00:0 to 23:59:59. For longer durations we must fool Numbers.
    First problem: we are adding several time durations. Each duration is in the authorized range and the result is greater than 24 hours.
    As before, starting-time values are in column B, ending-time ones are in column C, and the elapsed time value is in column D. The formula is:
    =IF(OR(ISBLANK(B),ISBLANK(C)),"",IF(TIMEVALUE(C)>TIMEVALUE(B),0,1)+TIMEVALUE(C) -TIMEVALUE(B))
    in column E, the formula for the cumulative elapsed time value is:
    =SUM($D$2:D2)
    in column F, converting to time format, the formula is:
    =TIME(0,0,ROUND(MOD(E,1)24*6060,0))
    in column G, the formula for showing more than 24 hours in the day/hour/minute format is:
    =IF(E<1,"",INT(E)&IF(E<2," day "," days "))&F
    in column H, expressing total elapsed time in total hours using the traditional time format, the formula is:
    =IF(E<1,F,INT(E)*24+LEFT(F,LEN(F)-6)&RIGHT(F,6))
    in column I, expressing total elapsed time in total hours using the traditional time format, an alternate formula is:
    =IF(E<1,F,INT(E)*24+HOUR(F)&":"&RIGHT("00"&MINUTE(F),2)&":"&RIGHT("00"&SECOND(F ),2))
    Of course the user would choose the format used in column G or the one in column I for his table. There is no need to keep all of them. It would be fine to hide column F whose contents are auxiliary.
    Second problem: individual durations may be greater than 23:59:59 hours.
    Again, column B is used to store starting date-time, column C stores ending date-time, and durations are calculated in column D. Since B and C are storing full date-time values, we may use this simple formula to find the duration:
    =C-B
    in column E, the time portion of the duration given in time format is:
    =TIME(0,0,ROUND(MOD(D,1)24*6060,0))
    in column F the formula to show the duration as days/hours/minutes is:
    =IF(D<1,"",INT(D)&IF(D<2," day "," day(s "))&E
    in column G we give the elapsed time in total hours using a time format. The formula is:
    =IF(D<1,E,INT(D)*24+LEFT(E,LEN(E)-6)&RIGHT(E,6))
    in column H we give the elapsed time in total hours using a time format. An alternate formula is:
    =IF(D<1,E,INT(D)*24+HOUR(E)&":"&RIGHT("00"&MINUTE(E),2)&":"&RIGHT("00"&SECOND(E ),2))
    If the duration is greater than 24 hours, the results in columns E and F are not a time value but a string. So the value in column D (which is time duration only) is useful.
    -+-+-+-+-
    *PROBLEM WITH ENTERING TIME*
    When you wish to enter 12:34 but 12 is the number of minutes, remember that Numbers will decipher this as 12 hours and 34 minutes. Simple tip:
    Assuming that your original entry is in column B, then in column C use this formula to align the minutes and seconds for proper Numbers interpretation:
    =IF(ISERROR(TIME(0,LEFT(B,SEARCH(":",B)-1),RIGHT(B,LEN(B)-SEARCH(":",B)))),"",T IME(0,LEFT(B,SEARCH(":",B)-1),RIGHT(B,LEN(B)-SEARCH(":",B))))
    -+-+-+-
    *MISCELLANEOUS NOTES*
    • Of course, the addition of two dates and multiplication or a division applied to one date means nothing and would generate the red triangle announcing a syntax error.
    • We may add a time value to a date-time: If B contains a date-time and C contains a time, the following formula will return the sum of the two values:
    =B+TIMEVALUE(C)
    • We may strip the time value of a full date-time one with the formula: =DATE(YEAR(B),MONTH(B),DAY(B))
    • Just as a reminder,
    =EDATE(B, 3) adds 3 months to the pure date stored in B
    so, of course,
    =EDATE(B, 12) adds one year to the pure date stored in B
    • If B and C store date-time values,
    =C-B returns the difference in decimal days.
    =DATEDIF(B,C,"D") returns the number of days between the two pure dates. It's identical to =DATE(YEAR(C),MONTH(C),DAY(C))-DATE(YEAR(B),MONTH(B),DAY(B))
    =DATEDIF(B,C,"M") returns the number of months between the two pure dates.
    =DATEDIF(B,C,"Y") returns the number of years between the two pure dates.
    Three other variants are available which use the parameters "MD","YM" and "YD".
    Yvan KOENIG (from FRANCE lundi 25 août 2008 15:23:34)

    KOENIG Yvan wrote in his "*STORED DATE-TIME VALUES - BASICS*" section:
    The minimal time unit is the second because time values are in fact a pseudo string representing the number of seconds between the date-time and the base date-time, 1 janvier 1904 00:00:00.
    This is not exactly true. Numbers files store date-time values in a string format consistent with ISO 8601:2004. This format explicitly includes year, month, day, hour, minute, & second values.
    This may be verified by examining the uncompressed index.xml file in a Numbers package. For example, the first day of 1904 is stored as cell-date="1904-01-01T00:00:00+0000" & of the year 0001 as cell-date="0001-01-01T00:00:00+0000." This format is not a numeric value of seconds from a base date-time, often referred to as a "serial time" format, that is used in applications like AppleWorks (or Excel?).
    Note that the time value (all that follows the "T" in the string) actually has four components, the last one (following the plus) representing the time zone offset from UTC time in minutes. AFAIK, Numbers does not set this to anything besides "+0000" but interestingly, it will attempt to interpret it if set by manually editing the file. For example, change cell-date="1904-01-01T00:00:00+0000" to cell-date="1904-01-01T00:00:00+0120" & the cell will display the last day of December of 1903 as the date, but will still show the time as 00:00:00. This suggests a future version of Numbers might be time zone aware, but currently it is unreliable & not fully implemented.
    Anyway, Numbers does not use the first day of 1904 as a reference for stored date-time values, although it will add that date to "dateless" time values imported from AppleWorks spreadsheets. Although I have not verified this, I believe it will also seamlessly translate between ISO & serial time formats as needed for Excel imports & exports, using the first day of 1900 as needed.
    Some other things to note about the ISO standard:
    • It permits fractional time values in the smallest time unit present, so for example "T10:15:30" could be represented as "T10:15.5" but Numbers does not support this -- the cell will appear empty if the index file is manually edited this way.
    • It does not stipulate whether date-time values represent intervals or durations (although it includes an explicit format for intervals between any two date-time values, known as a period). This means a future version of Numbers could support durations without the addition of a new data storage type, but legacy & import/export issues could make this too impractical to implement.
    • It supports a variety of other formats, including date-only, time-only, day-of-year, week-of-year, & various truncations (just hours & minutes, for example). All are unambiguous so a future version of Numbers could support them, but files generated with those versions would not be backwards compatible with the current version.
    For completeness, I will add that instead of using complex formulas to manipulate single-cell date-time values in Numbers, it is sometimes more straightforward to use multiple cells, one for each unit of time (for example, days, hours, minutes, & seconds), plus simple arithmetic formulas to combine them. Since each unit is a simple number, this results in highly portable, accurate, & "future-proof" tables, especially for durations. This is particularly useful for multimedia work in which the units might include video or film frames or audio samples.

  • Converting time

    Hi I was wondering if anyone could help me out with an application I am working on. I am trying to retrieve data from a text file and show it on a second form. i am having issues converting strings to classes. when i run it i get an exception to parse the
    string totake the date before putting each variable into the datetime object.
    Here is my code so far:
      private void CreateEventList()
             CommnunityEvents = new List<Community_Event>();
             // call the extract Data method.
             ExtractData();
             if (CommnunityEvents.Count > 0)
                //if there are no events for the date selected display the following
                eventComboBox.Text = " -Events- ";
                descriptionTextBox.Text = "Pick an event";
             else
                //if there are no events for the date selected display the following
                eventComboBox.Text = " No Events ";
                descriptionTextBox.Text = "No events today.";
          // Create Method ExtractData
          private void ExtractData()
             CommnunityEvents.Clear();
             // load the data from the file
             List<Community_Event> tempList = new List<Community_Event>();
             //string[] fileLines = File.ReadLines(@"C:\Users\IAN\Documents\calendar.txt");
             foreach(string line in File.ReadAllLines("Calendar.txt"))
                string[] items = line.Split(",".ToCharArray());
                   Community_Event newEvent = new Community_Event();
                   newEvent.Day = Convert.ToInt32(items[0]);//Converting the Integer to a string.
                   newEvent.Time = items[1];
                   newEvent.Price = Convert.ToInt32(items[2]);//Converting the decimal to a string.
                   newEvent.Event = items[3];
                   newEvent.Description = items[4];
             CommnunityEvents = (from ev in tempList
                                          where ev.Day == 1
                                          select ev).ToList();

    The Convert.ToInt32 methods converts the string to an int. You should use the Convert.ToDecimal to convert it to a decimal:
    newEvent.Price = Convert.ToDecimal(items[2]);//Converting the decimal to a string.
    Of course items[2] must contain a value that can actually be converted to a string for this to work. Alsom the Price property of the newEvent should be a decimal. Otherwise you also have the Convert.ToDouble method for example.
    Please remember to close your threads by marking helpful posts as answer and then start a new thread if you have a new question.

  • Working with Time Values

    Hello,
    I am constantly working with time values of the format Minutes:Seconds.Tenths of Seconds. So usually the values look like 2:01.8. I need to average these values, find standard deviations, etc...
    I'm having lots of trouble doing this in Numbers. Any advice?
    Henry

    In any spreadsheet I would suggest working with decimal value representations of the actual data for finding Deviations etc... just make a column that can be hidden after you've gotten your formulas figured out. Base your formulas on those numbers and convert back into your preferred format for the final answers.
    Hope this gives you some ideas,
    Jason

  • RFC Function Error: Cannot convert a value of 'MM/DD/YYYY' from type java.l

    hi experts,
    iam calling an RFC using SAP_JCO_Function. one of the input parameters is date which shud be in the format 'MM/DD/YYYY' but when i create a transaction property of data type DATETIME the format changes to " 2007-06-21 14:31:50 ". to refrain form passing this value at run time i have defined the transaction property as string and defaulted the value to MM/DD/YYYY.
    When i execute the RFC i get the error "Cannot convert a value of 'MM/DD/YYYY' from type java.l".
    Issue is with time field as well. Any suggestions would be appreciated.
    Thanks,
    Avinash

    Hi
    You can use datefromxmlformat( datetime, toformat ) .
    in toformat you give: "MM/dd/yyyy" and in datetime you pass your xml format date like: 2007-06-21 T14:31:50.
    Try like this. Hope this may help you.
    Thanks

  • Convert a String to Decimal Format in European format

    Hi Experts,
    I am having a string as a context type for a input field, where the user can enter the Price, I need to convert the same into European format "###.###,00", I am using this below code to convert the string to decimal format
    User will enter the input as 10 as it needs to be converted into 10,00. Also, 1000 which has to be converted as 1.000,00
    String Str1 = wdContext.currentvn_temptable.getVa_TempUnitPrice();
    Locale mylocale  = Locale.GERMAN;
    String pattern="###.###,00";                    
    NumberFormat nf = NumberFormat.getNumberInstance(mylocale);
    DecimalFormat df = (DecimalFormat)nf;
    df.applyPattern(pattern);
    String output = df.format(Str1);
    wdComponentAPI.getMessageManager().reportSuccess("Unit Price" + " " + pattern + " " + output);
    When I execute the above code, i am getting an error called "Malformed Pattern ###.###,00"
    Please let me know, how to convert a String to Quantity in European format
    Thanks & Regards,
    Palani

    Hello!
    Try to change your pattern to this one 
    Locale mylocale  = Locale.GERMAN;
    String pattern = "#,#00.00";                    
    NumberFormat nf = NumberFormat.getNumberInstance(mylocale);
    DecimalFormat df = (DecimalFormat)nf;
    df.applyPattern(pattern);
    String output = df.format(1111111.222);
    Pattern has an influence on number of digits between separators, but you have to use ',' for grouping and '.' for decimal. Character values for separators correspond to your Locale object.
    Thanks, Mikhail

  • Errors in the back-end database access module. OLE DB was unable to convert a value to the data type requested for column 5

     
    Hi All,
    I'm still struggling with the same cube and this is my 3rd post and once i fix some thing the other breaks. Please forgive me. When i process my cube i'm getting the error:
    Errors in the back-end database access module. OLE DB was unable to convert a value to the data type requested for column 5.
    My question is when the error says column 5 (is it the column 5 in the DSV?) or is it the column 5 in the DIMENSION list?
    My next question is the DSV Query works perfectly fine , so why this error in cube? This is what i have in the query in DSV.
    Please need help. In the below query both the column 5 (ArEASSIGNED TO VENDOR) in the CUBE and underlying table have the same data type and length VARCHAR(4000). Why is the process failing still?
    SELECT [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[compliancejoin]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_0],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[mowingsector]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_1],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[caseclosedflag]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_2],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[casehasvendorinfo]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_3],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[mowingstatus]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_4],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[assignedtovendor]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_5],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[reassignedtovendor]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_6],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[currentvendor]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_7],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[invoiced]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTSInvoiced0_8],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[invoicedstatus]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_9],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[casecloseddateid]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_10],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[assignedtovendordateid] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_11],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[reassigneddateid] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_12],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[currentassigneddateid] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_13],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[mowingduedateid] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_14],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[vendormoweddateid] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_15],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[captypename] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_16],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[casetype] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTSCaseType0_17],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[casenumbersubgroup] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_18],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[casetownship] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_19],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[casestatus] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTSCaseStatus0_20],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[caseopendateid] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_21],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[casereferredtolegalflag]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_22],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[casemacinitiatedflag] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_23],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[caseconversionstatusdesc]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_24],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[reasonforinvestigation] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_25],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[investigationopendateid]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_26],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[receiveddateid] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_27],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[assigned_department_staff]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_28],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[caseinitiator] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_29],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[vendorinvoiceamount] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_30],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[inspection_result] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_31],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[reason_for_complaint] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_32],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[vendor_action] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_33],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[complaint_source] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_34],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[contractcompliancevendor]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_35],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[invoicedstatusdateid] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_36],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[date_of_complaint_id] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_37],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[date_of_inspection_id] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_38],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[casenumber] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTSCaseNumber0_39],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[parcelnumber] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_40],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[row_index] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTSROW_INDEX0_41]
    FROM (SELECT CASE Isnumeric(
    accela_staging.dbo.fact_highweedsandgrassdetails.vendorinvoiceamount)
    WHEN 1 THEN Cast(
    fact_highweedsandgrassdetails.vendorinvoiceamount AS
    VARCHAR(
    10))
    END AS
    Total_Dollar_Amount,
    fact_highweedsandgrassdetails.casenumber,
    fact_highweedsandgrassdetails.row_index,
    fact_highweedsandgrassdetails.mowingsector,
    fact_highweedsandgrassdetails.caseclosedflag,
    fact_highweedsandgrassdetails.casecloseddateid,
    fact_highweedsandgrassdetails.maccomments,
    fact_highweedsandgrassdetails.lastfeeinvoicedateid,
    fact_highweedsandgrassdetails.casehasvendorinfo,
    fact_highweedsandgrassdetails.mowingstatus,
    fact_highweedsandgrassdetails.receiveddateid,
    fact_highweedsandgrassdetails.assignedtovendordateid,
    fact_highweedsandgrassdetails.assignedtovendor,
    fact_highweedsandgrassdetails.reassigneddateid,
    fact_highweedsandgrassdetails.reassignedtovendor,
    fact_highweedsandgrassdetails.currentvendor,
    fact_highweedsandgrassdetails.currentassigneddateid,
    fact_highweedsandgrassdetails.mowingduedateid,
    fact_highweedsandgrassdetails.vendormoweddateid,
    fact_highweedsandgrassdetails.invoiced,
    fact_highweedsandgrassdetails.invoicedstatus,
    fact_highweedsandgrassdetails.invoicedstatusdateid,
    fact_highweedsandgrassdetails.vendorinvoicenumber,
    fact_highweedsandgrassdetails.vendorcomments,
    fact_casedetails.captypename,
    fact_casedetails.casenumbersubgroup,
    fact_casedetails.casetype,
    fact_casedetails.township AS
    CaseTownship,
    fact_casedetails.casestatus,
    fact_casedetails.caseopendateid,
    fact_casedetails.referredtolegalflag AS
    CaseReferredToLegalFlag,
    fact_casedetails.macinitiatedflag AS
    CaseMACInitiatedFlag,
    fact_casedetails.conversionstatusdesc AS
    CaseConversionStatusDesc,
    fact_casedetails.assignedstaff AS
    CaseAssignedStaff,
    fact_casedetails.completedstaff AS
    CaseCompletedStaff,
    fact_casedetails.closedbystaff AS
    CaseClosedByStaff,
    fact_casedetails.initiator AS
    CaseInitiator,
    fact_casedetails.reasonforinvestigation,
    fact_casedetails.primaryaddress,
    fact_casedetails.parcelnumber,
    Cast(Datediff([day],
    fact_highweedsandgrassdetails.receiveddatetime,
    COALESCE (fact_highweedsandgrassdetails.casecloseddate,
    fact_highweedsandgrassdetails.vendormoweddate,
    fact_highweedsandgrassdetails.recordimportdatetime)) AS
    DECIMAL(6, 2))
    AS
    DaysOpen,
    Cast(Datediff([day],
    fact_highweedsandgrassdetails.receiveddatetime,
    COALESCE
    (fact_highweedsandgrassdetails.vendormoweddate,
    fact_highweedsandgrassdetails.casecloseddate,
    fact_highweedsandgrassdetails.recordimportdatetime)) AS
    NUMERIC(9, 2))
    * 24 AS
    HoursOpenToMow,
    Cast(Datediff([day],
    fact_highweedsandgrassdetails.assignedtovendordate,
    COALESCE
    (fact_highweedsandgrassdetails.vendormoweddate,
    fact_highweedsandgrassdetails.casecloseddate,
    fact_highweedsandgrassdetails.recordimportdatetime)) AS
    NUMERIC(9, 2))
    * 24 AS
    HoursAssignedToMow,
    CASE
    WHEN mowingstatus = 'Mowed'
    OR mowingstatus = 'Closed' THEN 1
    ELSE 0
    END AS
    NumberComplete,
    fact_highweedsandgrassdetails.recordimportdatetime,
    fact_casedetails.macsiebelnumber,
    fact_highweedsandgrassdetails.mowingduedate,
    fact_highweedsandgrassdetails.vendormoweddate,
    fact_highweedsandgrassdetails.lastfeeinvoicedate,
    fact_highweedsandgrassdetails.investigationopendatetime,
    fact_highweedsandgrassdetails.investigationopendate,
    fact_highweedsandgrassdetails.investigationopendateid,
    Cast(Datediff([day],
    fact_highweedsandgrassdetails.investigationopendatetime,
    CASE
    WHEN
    ( vendormoweddatetime IS NOT NULL
    AND vendormoweddatetime <=
    fact_highweedsandgrassdetails.casecloseddate ) THEN
    fact_highweedsandgrassdetails.vendormoweddatetime
    ELSE
    CASE
    WHEN (
    fact_highweedsandgrassdetails.casecloseddate IS
    NOT NULL
    AND fact_highweedsandgrassdetails.casecloseddate
    <=
    fact_highweedsandgrassdetails.recordimportdatetime )
    THEN
    fact_highweedsandgrassdetails.casecloseddate
    ELSE fact_highweedsandgrassdetails.recordimportdatetime
    END
    END) AS NUMERIC(9, 2)) * 24 AS
    AbatementDurationHoursOLD,
    Cast(Datediff([day],
    fact_highweedsandgrassdetails.investigationopendatetime,
    CASE
    WHEN
    COALESCE (vendormoweddatetime,
    fact_highweedsandgrassdetails.casecloseddate) IS
    NOT NULL THEN COALESCE (vendormoweddatetime,
    fact_highweedsandgrassdetails.casecloseddate)
    ELSE
    CASE
    WHEN ( fact_highweedsandgrassdetails.casecloseddate IS NOT NULL
    AND fact_highweedsandgrassdetails.casecloseddate <=
    fact_highweedsandgrassdetails.recordimportdatetime ) THEN
    fact_highweedsandgrassdetails.casecloseddate
    ELSE fact_highweedsandgrassdetails.recordimportdatetime
    END
    END) AS NUMERIC(9, 2)) * 24 AS
    AbatementDurationHours,
    fact_casedetails.assigneddepartment,
    COALESCE (fact_casedetails.assignedstaff, '[null]')
    + '/'
    + COALESCE (fact_casedetails.assigneddepartment, '[null]') AS
    Assigned_Department_Staff,
    fact_highweedsandgrassdetails.casecloseddate,
    fact_highweedsandgrassdetails.receiveddatetime,
    fact_highweedsandgrassdetails.assignedtovendordate,
    fact_highweedsandgrassdetails.vendorinvoiceamount,
    fact_highweedsandgrassdetails.invoicedstatusdate,
    fact_highweedsandgrassdetails.complaint_source,
    fact_highweedsandgrassdetails.inspection_result,
    fact_highweedsandgrassdetails.reason_for_complaint,
    fact_highweedsandgrassdetails.contractcompliancevendor,
    fact_highweedsandgrassdetails.vendor_action,
    fact_highweedsandgrassdetails.date_of_complaint_id,
    fact_highweedsandgrassdetails.date_of_inspection_id,
    CONVERT(INT, Replace(Replace(fact_highweedsandgrassdetails.casenumber,
    'HWG', 0)
    , '-', 0)) AS compliancejoin,
    fact_highweedsandgrassdetails.maccomments AS Expr1,
    dbo.dim_highweedscensustracts.b1_census_tract
    FROM dbo.fact_highweedsandgrassdetails
    INNER JOIN dbo.fact_casedetails
    ON fact_highweedsandgrassdetails.casenumber =
    fact_casedetails.casenumber
    INNER JOIN dbo.dim_highweedscensustracts
    ON fact_highweedsandgrassdetails.casenumber =
    dbo.dim_highweedscensustracts.casenumber
    GROUP BY fact_highweedsandgrassdetails.casenumber,
    fact_highweedsandgrassdetails.row_index,
    fact_highweedsandgrassdetails.mowingsector,
    fact_highweedsandgrassdetails.caseclosedflag,
    fact_highweedsandgrassdetails.casecloseddateid,
    fact_highweedsandgrassdetails.maccomments,
    fact_highweedsandgrassdetails.lastfeeinvoicedateid,
    fact_highweedsandgrassdetails.casehasvendorinfo,
    fact_highweedsandgrassdetails.mowingstatus,
    fact_highweedsandgrassdetails.receiveddateid,
    fact_highweedsandgrassdetails.assignedtovendordateid,
    fact_highweedsandgrassdetails.assignedtovendor,
    fact_highweedsandgrassdetails.reassigneddateid,
    fact_highweedsandgrassdetails.reassignedtovendor,
    fact_highweedsandgrassdetails.currentvendor,
    fact_highweedsandgrassdetails.currentassigneddateid,
    fact_highweedsandgrassdetails.mowingduedateid,
    fact_highweedsandgrassdetails.vendormoweddateid,
    fact_highweedsandgrassdetails.invoiced,
    fact_highweedsandgrassdetails.invoicedstatus,
    fact_highweedsandgrassdetails.invoicedstatusdateid,
    fact_highweedsandgrassdetails.vendorinvoicenumber,
    fact_highweedsandgrassdetails.vendorcomments,
    fact_casedetails.captypename,
    fact_casedetails.casenumbersubgroup,
    fact_casedetails.casetype,
    fact_casedetails.township,
    fact_casedetails.casestatus,
    fact_casedetails.caseopendateid,
    fact_casedetails.referredtolegalflag,
    fact_casedetails.macinitiatedflag,
    fact_casedetails.conversionstatusdesc,
    fact_casedetails.assignedstaff,
    fact_casedetails.completedstaff,
    fact_casedetails.closedbystaff,
    fact_casedetails.initiator,
    fact_casedetails.reasonforinvestigation,
    fact_casedetails.primaryaddress,
    fact_casedetails.parcelnumber,
    fact_highweedsandgrassdetails.vendormoweddatetime,
    Cast(Datediff([day],
    fact_highweedsandgrassdetails.receiveddatetime,
    COALESCE (
    fact_highweedsandgrassdetails.casecloseddate,
    fact_highweedsandgrassdetails.vendormoweddate,
    fact_highweedsandgrassdetails.recordimportdatetime))
    AS
    NUMERIC(9, 2)),
    Cast(Datediff([day],
    fact_highweedsandgrassdetails.receiveddatetime,
    COALESCE (
    fact_highweedsandgrassdetails.vendormoweddate,
    fact_highweedsandgrassdetails.casecloseddate,
    fact_highweedsandgrassdetails.recordimportdatetime))
    AS
    NUMERIC(9, 2)),
    Cast(Datediff([day],
    fact_highweedsandgrassdetails.assignedtovendordate,
    COALESCE (
    fact_highweedsandgrassdetails.vendormoweddate,
    fact_highweedsandgrassdetails.casecloseddate,
    fact_highweedsandgrassdetails.recordimportdatetime))
    AS
    NUMERIC(9, 2)),
    CASE
    WHEN mowingstatus = 'Mowed'
    OR mowingstatus = 'Closed' THEN 1
    ELSE 0
    END,
    fact_highweedsandgrassdetails.recordimportdatetime,
    fact_casedetails.macsiebelnumber,
    fact_highweedsandgrassdetails.mowingduedate,
    fact_highweedsandgrassdetails.vendormoweddate,
    fact_highweedsandgrassdetails.lastfeeinvoicedate,
    fact_highweedsandgrassdetails.investigationopendatetime,
    fact_highweedsandgrassdetails.investigationopendate,
    fact_highweedsandgrassdetails.investigationopendateid,
    Cast(Datediff([day],
    fact_highweedsandgrassdetails.investigationopendatetime,
    CASE
    WHEN
    ( vendormoweddatetime IS NOT NULL
    AND vendormoweddatetime <=
    fact_highweedsandgrassdetails.casecloseddate ) THEN
    fact_highweedsandgrassdetails.vendormoweddatetime
    ELSE
    CASE
    WHEN (
    fact_highweedsandgrassdetails.casecloseddate
    IS NOT NULL
    AND
    fact_highweedsandgrassdetails.casecloseddate <=
    fact_highweedsandgrassdetails.recordimportdatetime )
    THEN
    fact_highweedsandgrassdetails.casecloseddate
    ELSE
    fact_highweedsandgrassdetails.recordimportdatetime
    END
    END) AS NUMERIC(9, 2)),
    Cast(Datediff(ss,
    fact_highweedsandgrassdetails.investigationopendatetime,
    CASE
    WHEN
    COALESCE (vendormoweddatetime,
    fact_highweedsandgrassdetails.casecloseddate) IS
    NOT NULL THEN COALESCE (vendormoweddatetime,
    fact_highweedsandgrassdetails.casecloseddate)
    ELSE
    CASE
    WHEN
    ( fact_highweedsandgrassdetails.casecloseddate IS NOT NULL
    AND fact_highweedsandgrassdetails.casecloseddate <=
    fact_highweedsandgrassdetails.recordimportdatetime ) THEN
    fact_highweedsandgrassdetails.casecloseddate
    ELSE fact_highweedsandgrassdetails.recordimportdatetime
    END
    END) AS NUMERIC(18, 2)) * 60,
    fact_casedetails.assigneddepartment,
    COALESCE (fact_casedetails.assignedstaff, '[null]')
    + '/'
    + COALESCE (fact_casedetails.assigneddepartment, '[null]'),
    fact_highweedsandgrassdetails.casecloseddate,
    fact_highweedsandgrassdetails.receiveddatetime,
    fact_highweedsandgrassdetails.assignedtovendordate,
    fact_highweedsandgrassdetails.vendorinvoiceamount,
    fact_highweedsandgrassdetails.invoicedstatusdate,
    fact_highweedsandgrassdetails.complaint_source,
    fact_highweedsandgrassdetails.inspection_result,
    fact_highweedsandgrassdetails.reason_for_complaint,
    fact_highweedsandgrassdetails.contractcompliancevendor,
    fact_highweedsandgrassdetails.vendor_action,
    fact_highweedsandgrassdetails.date_of_complaint_id,
    fact_highweedsandgrassdetails.date_of_inspection_id,
    CONVERT(INT, Replace(
    Replace(fact_highweedsandgrassdetails.casenumber, 'HWG', 0)
    , '-', 0)),
    fact_highweedsandgrassdetails.maccomments,
    dbo.dim_highweedscensustracts.b1_census_tract) AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS]
    ORDER BY [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[compliancejoin]
    ASC
    SV

    I just counted the columns from the top:
    1) compliancejoin, 2) mowingsector, 3) caseclosedflag, 4) casehasvendorinfo, 5) mowingstatus, 6) assignedtovendor.
    I see now that your subject line talks about column 6, but you say column 5 in body of your original post.
    I don't know anything about cubes, but apparently there is some mapping problem when you run it from SSAS. (I assume it is SSAS, a part of the product I'm entirely ignorant of.) I figured that if you had got tripped by the zero-based numbering, you
    might be staring on the wrong column.
    Erland Sommarskog, SQL Server MVP, [email protected]

Maybe you are looking for