Date and time diffrence calculations

Dear Experts,
I have a doubt regarding the date and time diffrence calculation please help me out.
This is regarding the report called u201CVehicle tracking systemu201D. The purpose of this report is to give the user information like how many vehicles have come in and how much time each vehicle has parked in the filling in the refinery and also the average time taken for a customer.
For this we have created 4 info objects called
1)     Park In Time
2)     Park In Date
3)     Gate Out Time
4)     Gate Out Date
We have created a routine which calculate the difference in Vehicle Park In Date & Time to Gate Out Time and Date
The Time difference is number format.
Example: For Vehicle1
Park in Date and Park in Time are         27.11.2008 and 17:43:35
Gate out Date and Gate out Time are     29.11.2008 and 09:36:16            
Here routine will calculate the difference in the above date and time and the output is like this     1,155.138,000 (i.e. 1day, 15 hours 51 mins and 38 seconds) that means the vehicle has parked for 1 day and 15 hours etc.
But we require the output like    1 day, 15:51:38
Please give us the solution how to go about it.
Thanks in advance,
venkat

Hi,
I think in regard to your problem, the solution will be to make the variables in the query runtime by the replacement path variable.
Please find the below link, its very much self explanatory and in regard to your problem.
Hope it helps!
[http://sd-solutions.com/documents/SDS_BW_Replacement%20Path%20Variables.html]
Regards,
Neha.

Similar Messages

  • SAP BI Date and Time Difference calculations in DSO Transformation

    Hello Guys,
    Could you please tell me how to calculate the date and Time difference between 2 fields.
    I have 2 date fields :
    Arrival Date : 6/16/2007
    Departure date : 6/19/2007
    Also i have 2 time fields for the above
    Arrival Time : 13:00:00
    Departure Time : 11:50:00
    I want to display all the four fields and 2 fields for the difference in Date and Time.
    Is it better to calcuate the differences in DSO Transformation or can you do it in the report itself.Could you please let me know the solution.
    Thanks,
    BI Consultant

    Hello Consulant BI,
    Computing the difference of two dates is easy (assuming you really just want the number of days). You can simply subtract the two dates using ABAP:
    data: w_arrival_date type sy-datum,
            w_dep_date type sy-datum,
            w_diff type i.
    w_arrival_date = <your arrival date field here>.
    w_arrival_date = <your departure field here>.
    w_diff  = w_arrival_date - w_dep_date.
    Getting the time difference isn't really much logical. I think what you want instead is to compute the totals days (and extra hours) right? If this is the case, then you can convert the date+time for both the arrival and departure  into a timestamp variable first and then t the get difference.
    Hope this helps.

  • There is something wrong with the volumes buttons in my macbook pro, every time i pressed the one who raises the volume, it leads me to the screen where (i do not no what its called) the background is black with the date and time and a calculator.

    There is something wrong with the volumes buttons in my macbook pro, every time i pressed the one who raises the volume, it leads me to the screen where (i do not no what its called) the background is black with the date and time and a calculator. However, when i lower it, my safari tab goes out of the screen. What do you guys think i should do? I'm getting very nervous.

    hey HAbrakian!
    You may want to try using the information in this article to adjust the behavior of your function keys to see if that resolves the behavior:
    Mac OS X: How to change the behavior of function keys
    http://support.apple.com/kb/ht3399
    Take care, and thanks for visiting the Apple Support Communities.
    -Braden

  • Date and Time calculation in the Service Module

    Dear all,
    I have quite of a challenge here and i need serious guidance from your side.
    My client is in services industry and requires to calculate the date and time when the service call as to be closed. Not only it depends on the contract type the service is linked to but as well on the priority.
    The priority in Business One is unique, therefore we created a UDT (User Defined Table) to store the different 'response time' per contract/per priority. Example: a Platinum contract is always 24/7. But a gold contract priority 1 has to be closed in 240 minutes (4 workable hours) while a gold contract priority 2 has to be closed in 480 minutes (8 workable hours).
    I created 7 user defined fields on the Service Contract header that calculates the workable minutes per day. So if my coverage for Monday is from 8 AM to 4 PM, my UDF called DiffMon will show 480. For Tuesday, they start a bit later, and the coverage is 8:30 untill 16:00, therefore my UDF called DiffTue = 450.If the check box before the day in the Service Contract window is not ticked, then the UDF shows zero.
    I succeeded to calculate the expected closing time by using CASE WHEN statements as following, (all calculated in minutes):
         First, I need to check which day the Service call is created: A Monday or Thursday or... since my time coverage can change every day! I use SET DATEFIRST = 1 and compare today's date accordingly with my UDF DiffMon, DiffTue, etc.
         Then, When end of coverage time today Monday (4PM) minus the create time on the Service Call (1PM) is less then the time stored in my user defined table for that contract and that priority (i.e.480), then just add that to the create time and the create date (DateAdd(mi,...,...) ).
        When end of coverage time Monday (4PM) - Create time (1PM) + DiffTue(450) is bigger than 480, then I know I have enough time to solve my service call tomorrow Tuesday and I take the start time of Tuesday (8:30) + remaining time from yesterday (480-180 -> 180 = 3hours from 1PM to 4PM) and add that to the Create date + 1 so the end result will show Tuesday date and a time of 13:30
       Etc. untill I cover all possibilities based on which day is the service call created.
    NOW, I need to include the holiday table !!!!!!!!!!  And I can't foresee how the hell I am going to do that.
    The maximum coverage can go up to 60 hours, that means more than a working week! What happens if I have more than one bank holiday in that week period? What happens when my holiday table tells me that  date is a bank holiday but it is actually a Sunday and my contract is only running from Monday to Friday?
    Am I going straight to a big mess up?
    I will highly appreciate your comments,
    Regards,
    Frederic

    Hi,
    it is possible in query designer,
    u do the two things for getting the days between to dates
    1) in CMOD write the code for sy-datum create a customer exit variable in query as on caldate like eg zcedate
    when 'zcedate'.
    clear l_s_range.
    l_s_range-sign = 'i'.
    l_s_range-opt = 'eq'.
    l_s_range-low = sy-datum.
    append l_s_range to e_t_range.
    u write this code exit_saplrrso_001.
    it givs the sydatum
    2) then u create one more variable on zdate limit with replacement path
    then u go forto create the formula variable then it display ascreen there u select both customer exit variable and replacement path variable
    zcedate-replacementpathvariable
    it gives days i worked on this and succedded.
    like the same way fortime also u can do but here at the time of creating the customer exit varible u go for option as range here
    l_s_range-low = '20012009'
    l_s_range-high = '29012009'
    l_s_range-sign ='i'.
    l_s_range-opt = 'bt'.
    please try with the above one.
    Thanks & rEgards,
    k.sathish

  • Date and Time Calculation in Bex.

    Hi All,
    I want to calculate the number of days and the time by subtracting from two dates and time.
    Ex : 27-Jan-2009 10.30AM  - 20-Jan-2009 10.00AM
    Result : 6 days 23 hrs
    In my ODS, i have FROM date, time and TO date,time are in Characteristics.
    is it possible do it in the Query designer.
    Pls provide me the steps.
    Thanks,
    Ram.
    Edited by: Ram Siva on Jan 27, 2009 6:29 AM

    Hi,
    it is possible in query designer,
    u do the two things for getting the days between to dates
    1) in CMOD write the code for sy-datum create a customer exit variable in query as on caldate like eg zcedate
    when 'zcedate'.
    clear l_s_range.
    l_s_range-sign = 'i'.
    l_s_range-opt = 'eq'.
    l_s_range-low = sy-datum.
    append l_s_range to e_t_range.
    u write this code exit_saplrrso_001.
    it givs the sydatum
    2) then u create one more variable on zdate limit with replacement path
    then u go forto create the formula variable then it display ascreen there u select both customer exit variable and replacement path variable
    zcedate-replacementpathvariable
    it gives days i worked on this and succedded.
    like the same way fortime also u can do but here at the time of creating the customer exit varible u go for option as range here
    l_s_range-low = '20012009'
    l_s_range-high = '29012009'
    l_s_range-sign ='i'.
    l_s_range-opt = 'bt'.
    please try with the above one.
    Thanks & rEgards,
    k.sathish

  • Odd Date for Current Date and Time

    I am modifying a column in a list to get current date and time using =TODAY()+NOW() in the calculated field and get a time that is behind by 1 hour but the date is 4 months 114 years ahead (2128). How can I fix this field?

    http://sharepointsolutions.com/sharepoint-help/blog/2011/04/how-to-add-and-subtract-hours-and-minutes-from-date-and-time-fields-in-sharepoint-lists/

  • Date and time field help

    Hey guys and gals,
    I'm working on a basic simple form that I'd like to use as a fax cover sheet and I'm brand new at this and I just can't find the answer anywhere. The only way I can get it to show the date and time is if I choose calculated - read only, then runtime property. But then it changes every time you open the document. It doesn't autofill the date and time any other way. Is there a way to make the date and time auto fill ONLY the first time you fill it out and then lock that field? Or do you just have to choose one of the other options, i.e., user entered - optional, recommended or required and then type it in? Which I don't really get either, because those just give you a blank field that you type in. I don't see the difference between those options and a text field. I thought maybe I could upload the pdf to show you, but I guess you can't do that here. Anyway using Acrobat 9 pro on Vista.

    It sounds like you're using LiveCycle Designer, not Acrobat, to create the form. If that's the case, you should post this question in the LiveCycle Designer forum: http://forums.adobe.com/community/livecycle/livecycle_modules_and_development_tools/livecy cle_designer_es

  • Incrementing a string number for date and time

    There are probably a lot of ways to do this, but I only want to use a bunch of if - else loops if I really need to.
    I have a date and time for input, let's say 2006-04-19 22:00. In Java, if I convert that to 3 integers (year, month, day), it will output 2006-4-19. I need to be able to increment in a loop for every day and month from one date to the next. If I keep it as a string, I won't be able to increment the value though, (at least I'm not sure how). I'm thinking that even if I converted it to an integer and back to a string, that the leading zero would be removed.
    I found a post here that said something about formatting the number with 2 numbers, by using:
    DecimalFormat format = new DecimalFormat("00");
    format.format(1, sb, new FieldPosition(0));
    Or is there a way to use the gregorianCalendar stuff that would output the date with all of the zeros in place, while incrementing and looping correctly?
    Thanks.

    I would get a Date object--you can use java.text.SimpleDateFormat if you're starting with a String--and use that to create a GregorianCalendar. Then you can just call Calendar's add method to add one to whichever field you want. Use the SimpleDateFormat to turn the date back into a String for display again.
    Calculating Java dates: Take the time to learn how to create and use dates
    Working in Java time: Learn the basics of calculating elapsed time in Java
    Formatting a Date Using a Custom Format
    Parsing a Date Using a Custom Format

  • Automatically displaying date and time in a date/time field on form initialize

    Good day all;
    I am trying to have the current date and time automatically be generated in a “date/time” field when the form is opened.
    I went through the forum and found an entry from Srini “ xfa.host.messageBox("" + Date());” . Of course this brought up a system message box with the date and time.
    I then tried “DateTimeField1.rawValue = (“”+date())… This also gave me a system message box with the date and time…
    Please let me know where I am going wrong
    Chomp

    Found the answer... And yes... in was in the "help" section... What can I say I was making it a lot more crazy than I needed to.
    You can use a date/time field to automatically show the current date by using the Runtime Property option in the Value tab of the Object palette.
    When using a current date field, the date updates to reflect the system’s current date each time a user opens the form.
    1.
    In the Library palette, click the Standard category and drag a Date/Time Field object onto the form design.
    2.
    In the Object palette, click the Value tab and select Calculated - Read Only from the Type list.
    3.
    Select the Runtime Property option.
    4.
    View the form in the Preview PDF tab.

  • Current Date and Time control

    Hi,
    I'm using the Current Date control on my form.  This is OK for the date but I need the current time on a seperate control.
    I see it has binding options in the Object section ie date, date and time and time but only date seems to work.
    Does anyone know how I can set this to display the time only?
    thanks
    Paul

    Yes, that should be the answer.  But, as I said, when I select time only it still displays date and time.
    In the 'Value' tab, I've been trying different settings.  I set Type to User Entered options and Calculated options.  I only get a blank unless I set this to "Calculated - Read Only" and set the runtime property to the only option available which is 'Current Date/Time'
    So, there must be another setting that I need?
    thanks,
    Paul

  • How Production Order finish date and time is being comptued by SAP?

    Hello Expert,
    How Production Order finish date and time is being comptued by SAP? for example, we create a Production Order via CO01, the basic start date is 29.09.2008 and time is 04:00 it gives us basic finish date is 29.09.2008 and time is 13:28.
    how does SAP compute the time 13:28 as it finished time
    Please explain me briefly.
    Thanks
    Ryan

    Hello Guys,
    When we create Production Order in R/3 the time is calculated by routing but it is extended at SetUp machine time. It is not correct?. SetUp imachines time used only for first Production Order for the same product and it is plan manually, for others Production Order we need calculate time for production without SetUp machine time being pick up to compute finish time. how could we achieve this? only those Machine time will be check.
    thanks

  • Data and time characteristics found in character and keyfigures?

    hi all,
    I can find date and time found in both characteristics and keyfigures. Can anyone tell me in which scenario we shall select date and time considered in characteristics and when shall we select date and time for keyfigures.
    can anyone explain me with an scenario.
    regds
    hari

    Hi,
    date and time will be key figures in the case if you want to do some calculation based on them like subtraction or multiplication ( you can do it i also thorugh formula valriables but it has it's limitation)and they are not going to be used as drilldown or for selection variables in the reports.
    If you want only selection and drilldown on then then you should go for char.
    Thanks

  • Date and Time column in custom lists - is default time possible?

    I've created a custom list and included a column using the Date and Time field. I have this set up to default to "Today's Date." But, is there any way to also have this default to today's time? While the date will default, the time must be manually
    selected using dropdown boxes.
    We want this field to default to the date and time but also allow users to change the date and time if necessary. This is why we're using this instead of the "Created by" field, which is not editable.
    Has anyone found a solution to this?
    Thanks!

    Set calculated option for default value, and set =NOW():
    [custom.development]

  • Date and Time in Sender File Adapter Target Directory

    Hi there,
    is there a way of using Date and Time from XI to the Target Directory naming? To use variable substitution some fields of the message had to contain that date and time information, which is not our case.
    For filename you can use "add time stamp" option, but and for target directory?
    Thanks and regards,
    Henrique.

    > <i>Do you have further information on how to perform
    > this with shell commands?</i>
    > >> You need to write a shell script. This script will
    > add the date/time stamp into the folder in the target
    > system. This shell script is executed from the File
    > adapter. So once the file is written into the target
    > directory, then it will rename the directory.
    Hi there, Moorthy
    We've tried to write that shell script that you mentioned, but now we have a few doubts on how to make it create the proper directory.
    In the file adapter, my target directory is "/%var1%/%var2%/", where %var1% and %var2% are variable substitutions, referencing data which comes from the payload. Now, I need the shell script to append "/<Year>/<Month>/" in the target directory. But where to archive the script? If it stays in the root directory, than how to make it create "/<Year>/<Month>/" folders inside a directory which is variable (/%var1%/%var2%/)?
    Is there a way of passing %var1% and %var2% as parameters for the shell script?
    Thanks a lot,
    Henrique.

  • Unable to insert date and time when using date datatype

    Hi
    I am hitting a bit of a problem when using the date datatype. When trying to save a row to the table where the field it throws an error ora 01830 and complains about converting the date format picture ends...etc. Now when I do the insert, I use the to_date function with the format of "dd-mon-yyyy hh24:mi:ss". Of course, when I remove the time element, everything is perfect.
    Checking sysdate, I noticed that the time element wasn't be displayed, and I used alter session set nls_date_format to set the date and time I want to save to the table, which worked!
    Then based on advice in a previous thread to permanently fix the problem, I used alter system set nls_date_format ="dd-mon-yyyy hh24:mi:ss" scope=spfile; This showed that it was altered, and I can see the setting in the em. In sqlplus, I shutdown the database, and restarted with startup mount; alter database open; and then selecting sysdate, it still shows the date as dd-mon-yy, and still no time! Checking the em, and looking up the nls_date_format the setting is still shown as "dd-mon-yyyy hh24:mi:ss".
    So, my question is this - what am I doing wrong? Why can't save date and time using date in Oracle 11g?????
    Thanks

    user633278 wrote:
    Hi
    I am hitting a bit of a problem when using the date datatype. When trying to save a row to the table where the field it throws an error ora 01830 and complains about converting the date format picture ends...etc. Now when I do the insert, I use the to_date function with the format of "dd-mon-yyyy hh24:mi:ss". Of course, when I remove the time element, everything is perfect.
    Checking sysdate, I noticed that the time element wasn't be displayed, and I used alter session set nls_date_format to set the date and time I want to save to the table, which worked!
    Then based on advice in a previous thread to permanently fix the problem, I used alter system set nls_date_format ="dd-mon-yyyy hh24:mi:ss" scope=spfile; This showed that it was altered, and I can see the setting in the em. In sqlplus, I shutdown the database, and restarted with startup mount; alter database open; and then selecting sysdate, it still shows the date as dd-mon-yy, and still no time! Checking the em, and looking up the nls_date_format the setting is still shown as "dd-mon-yyyy hh24:mi:ss".
    So, my question is this - what am I doing wrong? Why can't save date and time using date in Oracle 11g?????
    ThanksYou most certainly can save the time. A DATE column, by definition stores date and time. What you describe is a presentation problem, and setting nls_date_format at the system as an init parm is the weakest of all settings as it is overridden by several other locations.
    without seeing the exact sql that produced the error (not just your description of what you think you were doing) it is impossible to say for sure.
    However, I'd suggest you read http://edstevensdba.wordpress.com/2011/04/07/nls_date_format/

Maybe you are looking for

  • Apps don't work after update.

    Anybody else have this problem?  I have first gen iPad and none of my apps will open. Any suggestions much appreciated.

  • ZEN MICRO Installation

    when I try to install the cd, it is closed because of a demoshield player problem!!!

  • Drop table to specific account.

    Hello All, I am using 11.2.0.3.0 on linux box. I have a requirement to given drop tables privilege to specific account. for example , I need to give ability to user c to drop tables from user A and user B schema. I know, "drop any table" would do the

  • How to keep file name formatted?

    I need to generate  .xlsx file as reporting purpose without renamed for example :- File names end with YYYYMMDD format for the day they are generated. Is that possible I can set up that kind of job? 

  • ASM Disk Migration

    HI There, Im working on an 11.2.0.3 GI and RDBMS running on AIX 7.1 I have a situation where one of the one of the ASM disk groups on a particular cluster consists of 20 disks, 10 of which need to be swapped out for 10 new disks. As far as I am aware