Time duration formula help

Post Author: ztruelove
CA Forum: Formula
I am needing to run a monthly report that shows how many hours our company cars have been "checked out" for that particular month. Each record has a "check out date" field in the format YYYY-MM-DD and a "check out time" field in the format 17:00:00  (and two more fields for check in date and time).  My questions are...
1) How do I extract only the hours for the month I'm reporting on?  Say I'm reporting on October, and the car was checked out on September 29th and returned on October 2nd...how do I just pull the October hours?
2) I just want to see "business hours" of 08:00 - 17:00.  So if the car was checked out on Friday, October 5th at 17:01 and checked back in on Tuesday, October 9 at 12:00, I would want to see a duration of 13 hours (9 hours from Monday and 4 hours from Tuesday).
Any suggestions or assistance is greatly appreciated.

Post Author: V361
CA Forum: Formula
You will need to modify the formula, I stole this from another post.
WhilePrintingRecords;
DateTimeVar FDay := {?Start Date};DateTimeVar LDay := {?End Date};
TimeVar BusinessStartTime := TimeValue("8:00");TimeVar BusinessEndTime := TimeValue("17:00");
NumberVar BSTime;NumberVar BETime;NumberVar Days;NumberVar Weekends;NumberVar FinalDays;DateVar StartDate;DateVar EndDate;NumberVar HalfDays;NumberVar FullDays;NumberVar Hours;
//Assign Business Start Time and Business End TimeBSTime := hour(BusinessStartTime) + (minute(BusinessStartTime) / 60);BETime := hour(BusinessEndTime) + (minute(BusinessEndTime) / 60);
//Check if Start Date and End Date fall within "Business Hours"if hour(FDay) in BSTime to BETime    then FDay := FDayelse if hour (FDay) > BETime    then FDay := datetime(date(FDay) + 1, BusinessStartTime)else if hour(FDay) < BSTime    then FDay := datetime(date(FDay), BusinessStartTime);
if hour(LDay) in BSTime to BETime    then LDay := LDayelse if hour(LDay) > BETime    then LDay := datetime(date(LDay),BusinessEndTime)else if hour(LDay) < BSTime    then LDay := datetime(date(LDay) - 1, BusinessEndTime);
//Check if Start Date and/or End Date falls on a weekendif DayOfWeek(FDay) = 7    then StartDate := date(FDay) + 2else if DayOfWeek(FDay) = 1    then StartDate := date(FDay) + 1else    StartDate := date(FDay);
if DayOfWeek(LDay) = 7    then EndDate := date(LDay) + 2else if DayOfWeek(LDay) = 1    then EndDate := date(LDay) + 1else    EndDate := date(LDay);
//Calculate # of days including Start Date and End DateDays := (EndDate - StartDate) + 1;
//Calculate # of weekend daysif Days >= 7    then WeekEnds := (Round((Days/7),0))*2else if DayOfWeek(StartDate) > DayOfWeek(EndDate)    then WeekEnds := 2else    WeekEnds := 0;
//Check if last day on a weekend and calculate final # of daysif DayOfWeek(LDay) = 7    then FinalDays := FinalDays - 1;
if DayOfWeek(LDay) = 1    then FinalDays := FinalDays - 2;
FinalDays := Days - Weekends;
//Calculate final # of hoursif FinalDays <= 1    then        (if hour (LDay) <= BETime            then hours := (time(LDay) - time(FDay)) / 3600        else hours := (BusinessEndTime - time(FDay)) / 3600)    else (HalfDays := ((BusinessEndTime - time(FDay)) / 3600 + (time(LDay) - BusinessStartTime) / 3600);        FullDays := (FinalDays - 2) * 9;        Hours := HalfDays + FullDays;        );
hours;

Similar Messages

  • RE: Simple Time Duration Formulas?

    I've recently attempted to import a Microsoft Excel document into Numbers, but the formulas don't seem to translate.
    I time scripts so all I need to do is create a formula to add up simple time equations. For example, if D3 is 00:30 and C4 is 01:00 I want C5 to tell me 01:30.
    Surely there's any easy way of doing this?
    All help gratefully received.

    Not really.
    In Excel you have time objects.
    In Pages we haven't. Your imported cells aren't storing 00:30 but the date_time 12 june 2011 00:30.
    Here is a way to achieve your goal :
    In C5, type :
    =DURATION(0,TIMEVALUE(D3)+TIMEVALUE(C4))
    Yvan KOENIG (VALLAURIS, France) dimanche 12 juin 2011 20:53:42
    iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.7
    Please : Search for questions similar to your own before submitting them to the community
    To be the AW6 successor, iWork MUST integrate a TRUE DB, not a list organizer !

  • Auto time stamp formula help

    Does anyone know how to make the auto time stamp to nit update. I figured out how to make a cell show the time whenever another cell is filled in. But I would like it not to update. Currently the cell I have updates whenever I do anything and I was hoping for it not to.
    Formula is
    =if(A1<1,hour(now()),minute(now()),second(now()),0)

    Little clunky, but one option: Select a cell. In menu, click on Insert, then Date & Time. In the cell, double-click the date that was inserted and in the box that shows, pick a format that has a time. The current time will get inserted into the cell.
    Another slightly less cumbersome option is to format 2 cells with Pop-up menus, one Pop-up to choose hour, then other Pop-up to choose minute. For example, if cell B2 has hour Pop-up and C2 has minute Pop-up, then D2 can have =TIME(B2,C2) and that would display your time, which can get used in other formulas.

  • How to calculate the time duration on a datetime column?

    Hi guys,
    I've done some search on this forum and everywhere else but I can't seem to get this right, at the beggining it sounded like something very simple to accomplish, for the instance with Excel but I'm struggling to get it to work with Crystal Reports on Microsoft Visual Studio 2008.
    I have a datetime column (SQL Server 2000) that I wanted to calculate the the time duration on the report group footer, unfortunatelly the built-in SUM function cannot be applied and I've tried several formulas that I've found on the internet without any luck. I'm using a datetime column to store only the time because I'm stuck with SQL Server 2000 which doesn't have a time data type.
    Would you guys know how to do it by any chance?
    Some sample code I've tried: http://www.minisolve.com/TipsAddUpTime.htm
    Thanks a lot,
    Paul
    Edited by: Paul Doe on Dec 12, 2009 5:41 PM
    Some sample data:
    EMPLOYEE     WORK HOURS
    =========     =================
    JOHN DOE      1900-01-01 01:00:05
    JOHN DOE      1900-01-01 00:20:00
    JOHN DOE      1900-01-01 01:30:15
    =========     =================
    HOURS WORKED: 02:50:20
    Edited by: Paul Doe on Dec 12, 2009 5:42 PM
    Edited by: Paul Doe on Dec 12, 2009 5:45 PM

    Guess what, by further testing the code on the website mentioned above I got it working.
    Pus, I needed to change the grouping on the code, so I had to come up with a way to update the formulas based on the groupping field.
    Considering "call_date" is the field that you are groupping by on the designer use the following code to update the formula:
    CrystalReportObj = new ReportDocument();
    CrystalReportObj.Load("C:\\reportfile.rpt");
    FieldDefinition FieldDef;
    //Get formula
    FormulaFieldDefinition FormulaDef1;
    FormulaDef1 = CrystalReportObj.DataDefinition.FormulaFields["SubHours"];
    //Get formula
    FormulaFieldDefinition FormulaDef2;
    FormulaDef2 = CrystalReportObj.DataDefinition.FormulaFields["subMinSec"];
    //Update the formula to work with the new grouping field,
    //this must be called first else will throw an exception
    FormulaDef1.Text = FormulaDef1.Text.Replace("call_date", "call_extension");
    FormulaDef2.Text = FormulaDef2.Text.Replace("call_date", "call_extension");
    //Get the new field we are grouping by
    FieldDef = CrystalReportObj.Database.Tables[0].Fields["call_extension"];
    //Replace current grouping field with the new one,
    //considering there only one group in the report, index 0
    CrystalReportObj.DataDefinition.Groups[0].ConditionField = FieldDef;
    Have fun.
    Edited by: Paul Doe on Dec 12, 2009 8:43 PM
    Edited by: Paul Doe on Dec 12, 2009 8:53 PM

  • How to find out the top 10 data loads based on time duration?.

    Hi,
    We are working on performance tuning. so we want to find out the top 10 loads which had run long time in date wise.
    We need the load start time and end time of the load process, Infosource and datatarget name.
    There are nearly 1000 loads, So it is very difficult to collect the load's timings in RSMO.
    Is there any another alternative to collect the top 10 loads based on time duration in date wise?
    Thanks & Regards,
    Raju

    Hi Gangaraju,
    You can install BI Statistics for getting these type of data.
    Or you check in RSDDSTAT or RSMDATASTATE_EXT or  table for the Load process time.
    Or goto t-code ST13 to get detailed analysis of a Process chain for a given period.
    Hope this helps.
    Regards,
    Ravi Kanth

  • How to display time duration (NOT dates) with an input mask in a JTable?

    Background: I am trying to display in a JTable, in two columns, the start position and time duration of an audio clip.
    They are stored as type float internally eg. startPosition = 72.7 seconds.
    However I wish to display on screen in the table in HH:mm:ss:S format. eg. 00:01:12:7. The user can edit the cell and input values to update the internal member fields.
    Problem: I am finding it very difficult to implement this - what with the interactions of MaskFormatter, DefaultCellEditor etc.
    Also using SimpleDateFormat and DateFormatter does not work as they insist on displaying the day, month, year also in the table cell.
    Taking the Swing Tutorial TableFTFEditDemo example as a template,
    (http://java.sun.com/docs/books/tutorial/uiswing/components/example-1dot4/index.html#TableFTFEditDemo)
    does anyone know how to do this?
    I can post my (buggy) modifications to the example code - if it would help.
    Appreciate any help.
    thanks,
    Anil

    Here are my modifications to the TableFTFEditDemo example. If you run it, you get an exception
    like java.lang.NumberFormatException: For input string: "18:00:03.500"
    The two modified classes are taken from the Tutorial and are listed below:
    =================
    * IntegerEditor is a 1.4 class used by TableFTFEditDemo.java.
    import javax.swing.AbstractAction;
    import javax.swing.BorderFactory;
    import javax.swing.DefaultCellEditor;
    import javax.swing.JFormattedTextField;
    import javax.swing.JOptionPane;
    import javax.swing.JTable;
    import javax.swing.JTextField;
    import javax.swing.KeyStroke;
    import javax.swing.SwingUtilities;
    import java.awt.event.ActionEvent;
    import java.awt.event.KeyEvent;
    import java.awt.Color;
    import java.awt.Component;
    import java.awt.Toolkit;
    import java.text.DateFormat;
    import java.text.NumberFormat;
    import java.text.ParseException;
    import java.text.SimpleDateFormat;
    import java.util.Calendar;
    import java.util.Date;
    import javax.swing.text.DateFormatter;
    import javax.swing.text.DefaultFormatterFactory;
    import javax.swing.text.MaskFormatter;
    import javax.swing.text.NumberFormatter;
    class TimeRenderer {
         float seconds;
         TimeRenderer(String str) {
              int hSec = Integer.parseInt(str.substring(0,2)) * 60 * 60;
              int mSec = Integer.parseInt(str.substring(2,4)) * 60;
              int sSec = Integer.parseInt(str.substring(4,6));
              float tSec = Integer.parseInt(str.substring(6,7))/10.0F;
              seconds = hSec + mSec + sSec + tSec;
    * Implements a cell editor that uses a formatted text field to edit Integer
    * values.
    public class IntegerEditor extends DefaultCellEditor {
         JFormattedTextField ftf;
         static Date zeroTime = new Date(0L);
         private boolean DEBUG = true;
         SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss.S");
         MaskFormatter maskFo = new MaskFormatter("##:##:##.#");
         protected MaskFormatter createFormatter(String s) {
              MaskFormatter formatter = null;
              try {
                   formatter = new MaskFormatter(s);
              } catch (java.text.ParseException exc) {
                   System.err.println("formatter is bad: " + exc.getMessage());
                   System.exit(-1);
              return formatter;
         public IntegerEditor(int min, int max) throws ParseException {
              super(new JFormattedTextField(new MaskFormatter("##:##:##.#")));
              ftf = (JFormattedTextField) getComponent();
              // Set up the editor for the cells.
              ftf.setFormatterFactory(new DefaultFormatterFactory(new DateFormatter(sdf)));
              ftf.setFocusLostBehavior(JFormattedTextField.PERSIST);
              // React when the user presses Enter while the editor is
              // active. (Tab is handled as specified by
              // JFormattedTextField's focusLostBehavior property.)
              ftf.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "check");
              ftf.getActionMap().put("check", new AbstractAction() {
                   public void actionPerformed(ActionEvent e) {
                        if (!ftf.isEditValid()) { // The text is invalid.
                             ftf.setBorder(BorderFactory.createLineBorder(Color.RED));
                             ftf.setBackground(Color.PINK);
                             ftf.postActionEvent(); // inform the editor
                        } else
                             try { // The text is valid,
                                  ftf.commitEdit(); // so use it.
                                  ftf.postActionEvent(); // stop editing
                             } catch (java.text.ParseException exc) {
         // Override to invoke setValue on the formatted text field.
         public Component getTableCellEditorComponent(JTable table, Object value,
                   boolean isSelected, int row, int column) {
              JFormattedTextField ftf = (JFormattedTextField) super
                        .getTableCellEditorComponent(table, value, isSelected, row, column);
              System.out.println("value:" + value);
    //          long milliseconds =(long) (Float.parseFloat(value.toString()) * 1000);
              long milliseconds =(long) (((Float) value).floatValue() * 1000);
              Date dt = new Date(milliseconds);
              ftf.setValue(dt);
              return ftf;
         // Override to ensure that the value remains an Integer.
         public Object getCellEditorValue() {
              JFormattedTextField ftf = (JFormattedTextField) getComponent();
              Object o = ftf.getValue();
              try {               
                   Calendar cal = Calendar.getInstance();
                   cal.setTime((Date)o);
                   float seconds = cal.getTimeInMillis()/1000.0F;
                   return sdf.format(o);
                   //return new Float(seconds);
              } catch (Exception exc) {
                   System.err.println("getCellEditorValue: can't parse o: " + o);
                   exc.printStackTrace();
                   return null;
         // Override to check whether the edit is valid,
         // setting the value if it is and complaining if
         // it isn't. If it's OK for the editor to go
         // away, we need to invoke the superclass's version
         // of this method so that everything gets cleaned up.
         public boolean stopCellEditing() {
              JFormattedTextField ftf = (JFormattedTextField) getComponent();
              if (ftf.isEditValid()) {
                   try {
                        ftf.commitEdit();
                   } catch (java.text.ParseException exc) {
              } else { // text is invalid
                   ftf.setBorder(BorderFactory.createLineBorder(Color.RED));
                   ftf.setBackground(Color.PINK);
                   return false; // don't let the editor go away
              return super.stopCellEditing();
    //=====================================================
    * TableFTFEditDemo.java is a 1.4 application that requires one other file:
    *   IntegerEditor.java
    import javax.swing.JFrame;
    import javax.swing.JDialog;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import javax.swing.table.AbstractTableModel;
    import java.awt.Dimension;
    import java.awt.GridLayout;
    import java.text.ParseException;
    * This is exactly like TableDemo, except that it uses a
    * custom cell editor to validate integer input.
    public class TableFTFEditDemo extends JPanel {
        private boolean DEBUG = false;
        public TableFTFEditDemo() throws ParseException {
            super(new GridLayout(1,0));
            JTable table = new JTable(new MyTableModel());
            table.setPreferredScrollableViewportSize(new Dimension(500, 70));
            //Create the scroll pane and add the table to it.
            JScrollPane scrollPane = new JScrollPane(table);
            //Set up stricter input validation for the integer column.
         //   table.setDefaultEditor(Float.class,
           //                        new IntegerEditor(0, 100));
         //If we didn't want this editor to be used for other
         //Integer columns, we'd do this:
         table.getColumnModel().getColumn(3).setCellEditor(
              new IntegerEditor(0, 100));
            //Add the scroll pane to this panel.
            add(scrollPane);
        class MyTableModel extends AbstractTableModel {
            private String[] columnNames = {"First Name",
                                            "Last Name",
                                            "Sport",
                                            "# of Years",
                                            "Vegetarian"};
            private Object[][] data = {
                {"Mary", "Campione",
                 "Snowboarding", new Float(5.7), new Boolean(false)},
                {"Alison", "Huml",
                 "Rowing", new Float(3.5), new Boolean(true)},
                {"Kathy", "Walrath",
                 "Knitting", new Float(2.9), new Boolean(false)},
                {"Sharon", "Zakhour",
                 "Speed reading", new Float(20.8), new Boolean(true)},
                {"Philip", "Milne",
                 "Pool", new Float(10.5), new Boolean(false)}
            public int getColumnCount() {
                return columnNames.length;
            public int getRowCount() {
                return data.length;
            public String getColumnName(int col) {
                return columnNames[col];
            public Object getValueAt(int row, int col) {
                return data[row][col];
             * JTable uses this method to determine the default renderer/
             * editor for each cell.  If we didn't implement this method,
             * then the last column would contain text ("true"/"false"),
             * rather than a check box.
            public Class getColumnClass(int c) {
                 Object obj = getValueAt(0, c);
                 System.out.println("getColumnClass.obj:" + obj);
                return obj.getClass();
            public boolean isCellEditable(int row, int col) {
                //Note that the data/cell address is constant,
                //no matter where the cell appears onscreen.
                if (col < 2) {
                    return false;
                } else {
                    return true;
            public void setValueAt(Object value, int row, int col) {
                if (DEBUG) {
                    System.out.println("Setting value at " + row + "," + col
                                       + " to " + value
                                       + " (an instance of "
                                       + value.getClass() + ")");
                data[row][col] = value;
                fireTableCellUpdated(row, col);
                if (DEBUG) {
                    System.out.println("New value of data:");
                    printDebugData();
            private void printDebugData() {
                int numRows = getRowCount();
                int numCols = getColumnCount();
                for (int i=0; i < numRows; i++) {
                    System.out.print("    row " + i + ":");
                    for (int j=0; j < numCols; j++) {
                        System.out.print("  " + data[i][j]);
                    System.out.println();
                System.out.println("--------------------------");
         * Create the GUI and show it.  For thread safety,
         * this method should be invoked from the
         * event-dispatching thread.
         * @throws ParseException
        private static void createAndShowGUI() throws ParseException {
            //Make sure we have nice window decorations.
            JFrame.setDefaultLookAndFeelDecorated(true);
            //Create and set up the window.
            JFrame frame = new JFrame("TableFTFEditDemo");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            //Create and set up the content pane.
            TableFTFEditDemo newContentPane = new TableFTFEditDemo();
            newContentPane.setOpaque(true); //content panes must be opaque
            frame.setContentPane(newContentPane);
            //Display the window.
            frame.pack();
            frame.setVisible(true);
        public static void main(String[] args) {
            //Schedule a job for the event-dispatching thread:
            //creating and showing this application's GUI.
            javax.swing.SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    try {
                             createAndShowGUI();
                        } catch (ParseException e) {
                             // TODO Auto-generated catch block
                             e.printStackTrace();
    }

  • Time duration of events

    Hello,
    I am accessing an Oracle 10.2.0.1.0 Database
    I have the following tables
    CREATE TABLE BT_MAPPING
    ( "TAG_ID" NUMBER(6,0) NOT NULL ENABLE,
    "TAG_NAME" VARCHAR2(30 BYTE) NOT NULL ENABLE,
    "TAG_DESCRIP" VARCHAR2(100 BYTE),
    "TAG_SRC1" VARCHAR2(30 BYTE),
    "TAG_SRC2" VARCHAR2(30 BYTE),
    "TAG_GRP_ID" NUMBER(4,0),
    "TAG_TYPE" VARCHAR2(2 BYTE),
    "TAG_DB" NUMBER(12,6),
    "TAG_ZERO" NUMBER(12,6),
    "TAG_SPAN" NUMBER(12,6),
    "TAG_EU" VARCHAR2(10 BYTE),
    "TAG_MIN" CHAR(1 BYTE),
    "TAG_MAX" CHAR(1 BYTE),
    "TAG_AVG" CHAR(1 BYTE),
    "TAG_DCM" NUMBER(4,0),
    "TAG_TYPE_ID" NUMBER(4,0),
    "TAG_TOTAL" CHAR(1 BYTE)
    and
    CREATE TABLE MT_ANALOGUE
    ( "TAG_ID" NUMBER(6,0) NOT NULL ENABLE,
    "TAG_DATE" DATE NOT NULL ENABLE,
    "TAG_VALUE" NUMBER(12,6),
    "TAG_QUALITY" NUMBER(6,0),
    "TAG_ADJUST_FLAG" CHAR(1 BYTE)
    I need to run a query that would return the tag_id, tag_name, tag_descrip from the bt_mapping table and the tag_date, tag_value from the analogue table when the tag_value is over .10 for the tags that are named BR_FL00_NI to BR_FL14_NI. I have the following which seems to work.
    SELECT
    BT.TAG_ID "TAG_ID", BT.TAG_NAME "TAG_NAME", BT.TAG_DESCRIP "TAG_DESCRIP", MT.TAG_DATE "TAG_DATE", MT.TAG_VALUE "TAG_VALUE"
    FROM
    BT_MAPPING BT, MT_ANALOGUE MT
    WHERE
    MT.TAG_ID=BT.TAG_ID
    AND
    MT.TAG_VALUE &gt; 0.10
    AND
    (BT.TAG_NAME like 'BR_FL0%_NI'
    OR BT.TAG_NAME like 'BR_FL1%_NI'
    OR bt.tag_name = 'BR_FWL00_NI')
    ORDER BY BT.TAG_NAME, MT.TAG_DATE;
    this is a sample of what data the query returns
    TAG_ID                 TAG_NAME                             TAG_DESCRIP                         TAG_DATE                  TAG_VALUE
    40076                    BR_FL01_NI                            Filter #1 Turbidity                       2009-02-05:01:51          0.112088
    40076                    BR_FL01_NI                            Filter #1 Turbidity                       2009-02-05:01:52          0.10696
    40076                    BR_FL01_NI                            Filter #1 Turbidity                       2009-02-05:01:53          0.101343
    40076                    BR_FL01_NI                            Filter #1 Turbidity                       2009-02-05:08:56          0.108181
    40076                    BR_FL01_NI                            Filter #1 Turbidity                       2009-02-05:08:57          0.144567
    40076                    BR_FL01_NI                            Filter #1 Turbidity                       2009-02-05:08:58          0.160684
    40076                    BR_FL01_NI                            Filter #1 Turbidity                       2009-02-05:08:59          0.195116
    40076                    BR_FL01_NI                            Filter #1 Turbidity                       2009-02-05:09:00          0.179976
    40076                    BR_FL01_NI                            Filter #1 Turbidity                       2009-02-05:09:01          0.178266
    40076                    BR_FL01_NI                            Filter #1 Turbidity                       2009-02-05:09:02          0.176557
    40076                    BR_FL01_NI                            Filter #1 Turbidity                       2009-02-05:09:03          0.175336
    40076                    BR_FL01_NI                            Filter #1 Turbidity                       2009-02-05:09:04          0.174359
    40076                    BR_FL01_NI                            Filter #1 Turbidity                       2009-02-05:09:05          0.174359
    40076                    BR_FL01_NI                            Filter #1 Turbidity                       2009-02-05:09:06          0.169475But I am wondering how to query the times that the value is &gt; .10 with a time duration &gt;= 15min and to have the time the tag_value was &gt; 0.10 and the last time the value was &gt; 0.10 with the duration in a new column?
    Something like this
    TAG_ID     TAG_NAME      TAG_DESCRIP        TAG_START_DATE_OVER      TAG_START_VALUE    TAG_END_DATE_OVER      TAG_END_VALUE      DURATION
    40076       BR_FL01_NI      Filter #1 Turbidity     2009-02-05:08:56                     0.108181                      2009-02-05:09:06                 0.169475                     20minI have searched the forums, but didn't find anything that applied. It's possible that I was searching for the wrong phrase. If anyone can provide some help, it would be appreciated.
    Cheers
    Edited by: scada on Feb 24, 2009 10:21 AM

    I will look into analytic functions and your sample code to see if I can get the results. I did forget the sample data, again. I have now included some sample data. so what i need to query is when tag_value is &gt; 0.10 for greater than 15 minutes for tags with tag name like 'BR_FL0%_NI' OR like 'BR_FL1%_NI' OR tag_name = 'BR_FWL00_NI'. I also would need a column in that query to be the time duration that the tag_value was &gt; 0.10.
    thanks again for all the help
    bt_mapping
    CREATE TABLE BT_MAPPING
    ( "TAG_ID" NUMBER(6,0) NOT NULL ENABLE,
    "TAG_NAME" VARCHAR2(30 BYTE) NOT NULL ENABLE,
    "TAG_DESCRIP" VARCHAR2(100 BYTE),
    "TAG_SRC1" VARCHAR2(30 BYTE),
    "TAG_SRC2" VARCHAR2(30 BYTE),
    "TAG_GRP_ID" NUMBER(4,0),
    "TAG_TYPE" VARCHAR2(2 BYTE),
    "TAG_DB" NUMBER(12,6),
    "TAG_ZERO" NUMBER(12,6),
    "TAG_SPAN" NUMBER(12,6),
    "TAG_EU" VARCHAR2(10 BYTE),
    "TAG_MIN" CHAR(1 BYTE),
    "TAG_MAX" CHAR(1 BYTE),
    "TAG_AVG" CHAR(1 BYTE),
    "TAG_DCM" NUMBER(4,0),
    "TAG_TYPE_ID" NUMBER(4,0)
    Insert into bt_mapping
    values (40652,'BR_FL10_NI','Filter #10 Turbidity','BRIPSS03','BRIPSS04',0,'AI',60,0,0,'0','1','1','1',3,2);MT_ANALOGUE TABLE
    CREATE TABLE MT_ANALOGUE
    ( "TAG_ID" NUMBER(6,0) NOT NULL ENABLE,
    "TAG_DATE" DATE NOT NULL ENABLE,
    "TAG_VALUE" NUMBER(12,6),
    "TAG_QUALITY" NUMBER(6,0),
    "TAG_ADJUST_FLAG" CHAR(1 BYTE)
    INSERT INTO MT_ANALOGUE VALUES
    ('40652',to_date('25-feb-2009 10:00','dd-mon-yyyy hh24:mi'),'.018816','0','0');
    INSERT INTO MT_ANALOGUE VALUES
    ('40652',to_date('25-feb-2009 10:01','dd-mon-yyyy hh24:mi'),'.028816','0','0');
    INSERT INTO MT_ANALOGUE VALUES
    ('40652',to_date('25-feb-2009 10:02','dd-mon-yyyy hh24:mi'),'.029548','0','0');
    INSERT INTO MT_ANALOGUE VALUES
    ('40652',to_date('25-feb-2009 10:03','dd-mon-yyyy hh24:mi'),'.029304','0','0');
    INSERT INTO MT_ANALOGUE VALUES
    ('40652',to_date('25-feb-2009 10:04','dd-mon-yyyy hh24:mi'),'.028816','0','0');
    INSERT INTO MT_ANALOGUE VALUES
    ('40652',to_date('25-feb-2009 10:05','dd-mon-yyyy hh24:mi'),'.028571','0','0');
    INSERT INTO MT_ANALOGUE VALUES
    ('40652',to_date('25-feb-2009 10:06','dd-mon-yyyy hh24:mi'),'.029548','0','0');
    INSERT INTO MT_ANALOGUE VALUES
    ('40652',to_date('25-feb-2009 10:07','dd-mon-yyyy hh24:mi'),'.029304','0','0');
    INSERT INTO MT_ANALOGUE VALUES
    ('40652',to_date('25-feb-2009 10:08','dd-mon-yyyy hh24:mi'),'.028816','0','0');
    INSERT INTO MT_ANALOGUE VALUES
    ('40652',to_date('25-feb-2009 10:09','dd-mon-yyyy hh24:mi'),'.028816','0','0');
    INSERT INTO MT_ANALOGUE VALUES
    ('40652',to_date('25-feb-2009 10:10','dd-mon-yyyy hh24:mi'),'.030037','0','0');
    INSERT INTO MT_ANALOGUE VALUES
    ('40652',to_date('25-feb-2009 10:11','dd-mon-yyyy hh24:mi'),'.028327','0','0');
    INSERT INTO MT_ANALOGUE VALUES
    ('40652',to_date('25-feb-2009 10:12','dd-mon-yyyy hh24:mi'),'.029792','0','0');
    INSERT INTO MT_ANALOGUE VALUES
    ('40652',to_date('25-feb-2009 10:13','dd-mon-yyyy hh24:mi'),'.028327','0','0');
    INSERT INTO MT_ANALOGUE VALUES
    ('40652',to_date('25-feb-2009 10:14','dd-mon-yyyy hh24:mi'),'.029792','0','0');
    INSERT INTO MT_ANALOGUE VALUES
    ('40652',to_date('25-feb-2009 10:15','dd-mon-yyyy hh24:mi'),'.029304','0','0');
    INSERT INTO MT_ANALOGUE VALUES
    ('40652',to_date('25-feb-2009 10:16','dd-mon-yyyy hh24:mi'),'.028816','0','0');
    INSERT INTO MT_ANALOGUE VALUES
    ('40652',to_date('25-feb-2009 10:17','dd-mon-yyyy hh24:mi'),'.028816','0','0');
    INSERT INTO MT_ANALOGUE VALUES
    ('40652',to_date('25-feb-2009 10:18','dd-mon-yyyy hh24:mi'),'.029548','0','0');
    INSERT INTO MT_ANALOGUE VALUES
    ('40652',to_date('25-feb-2009 10:19','dd-mon-yyyy hh24:mi'),'.028816','0','0');
    INSERT INTO MT_ANALOGUE VALUES
    ('40652',to_date('25-feb-2009 10:20','dd-mon-yyyy hh24:mi'),'.029792','0','0');
    INSERT INTO MT_ANALOGUE VALUES
    ('40652',to_date('25-feb-2009 10:21','dd-mon-yyyy hh24:mi'),'.029548','0','0');
    INSERT INTO MT_ANALOGUE VALUES
    ('40652',to_date('25-feb-2009 10:22','dd-mon-yyyy hh24:mi'),'.029548','0','0');
    INSERT INTO MT_ANALOGUE VALUES
    ('40652',to_date('25-feb-2009 10:23','dd-mon-yyyy hh24:mi'),'.029304','0','0');
    INSERT INTO MT_ANALOGUE VALUES
    ('40652',to_date('25-feb-2009 10:24','dd-mon-yyyy hh24:mi'),'.028816','0','0');
    INSERT INTO MT_ANALOGUE VALUES
    ('40652',to_date('25-feb-2009 10:25','dd-mon-yyyy hh24:mi'),'.028816','0','0');
    INSERT INTO MT_ANALOGUE VALUES
    ('40652',to_date('25-feb-2009 10:26','dd-mon-yyyy hh24:mi'),'.029304','0','0');
    INSERT INTO MT_ANALOGUE VALUES
    ('40652',to_date('25-feb-2009 10:27','dd-mon-yyyy hh24:mi'),'.028816','0','0');
    INSERT INTO MT_ANALOGUE VALUES
    ('40652',to_date('25-feb-2009 10:28','dd-mon-yyyy hh24:mi'),'.028571','0','0');
    INSERT INTO MT_ANALOGUE VALUES
    ('40652',to_date('25-feb-2009 10:29','dd-mon-yyyy hh24:mi'),'.029304','0','0');
    INSERT INTO MT_ANALOGUE VALUES
    ('40652',to_date('25-feb-2009 10:30','dd-mon-yyyy hh24:mi'),'.029304','0','0');
    INSERT INTO MT_ANALOGUE VALUES
    '40652',to_date('25-feb-2009 10:31','dd-mon-yyyy hh24:mi'),'.017304','0','0');Edited by: scada on Feb 25, 2009 12:08 PM
    Edited by: scada on Feb 25, 2009 1:21 PM
    Edited by: scada on Feb 26, 2009 10:51 AM
    Edited by: scada on Feb 26, 2009 10:58 AM

  • Time duration taken for a job to complete

    Hi
    How do I konw what is the time duration that has taken for any job to be completed  I am looking  in RSMO and i am able to see the start time in the header tab for a job .how do i see the completed time??
    Thanks
    Sheetal

    Hi Sheetal,
    Double click on the start time a popup box would appear in that you can watch the End time as well.
    Also below the Start time you can watch Run time as well,ie the Total Time taken to complete the data load.
    or
    you can check in SM37,
    Copy the Reuqest name from monitor screen and paste it in the SM37 enter the name of the person who scheduled it or enter* to select all users.
    you can find the Job details of that particular request.
    Hope this helps.
    Regards,
    Ravikanth

  • Time Duration tracking

    Hi ALL,
    I need to get total time duration of my user in my application. I got maximum time duration he has spent for a month from the below sample query .
    SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
    Date parseFinalTime=null;
    String totalDuration = "";
    long totDuration=0;
    String siteDuration="";
    String masterquery = new StringBuffer("SELECT max(TSIE52_SESSION_DURATION)  from STSIE52_USER_SESSION ").toString();
    ResultSet subResultSet = getResultSet(connection, masterquery);
    while (subResultSet.next()) {
    parseFinalTime = sdf.parse(subResultSet.getString(1));
    totDuration =parseFinalTime.getTime();
    totalDuration = sdf.format(new Date(totDuration));
    System.out.println("siteDuration---------------->::" +totalDuration);
    }The output I got as below:
    siteDuration---------------->::00:00:24
    siteDuration---------------->::00:00:05
    siteDuration---------------->::00:00:09
    siteDuration---------------->::00:00:14
    siteDuration---------------->::00:51:33
    siteDuration---------------->::00:16:42
    siteDuration---------------->::00:00:05
    siteDuration---------------->::00:00:25
    siteDuration---------------->::00:00:05
    siteDuration---------------->::00:00:10
    siteDuration---------------->::00:00:09
    siteDuration---------------->::00:03:02
    siteDuration---------------->::00:00:18
    siteDuration---------------->::00:00:11
    I need to total all the times mentioned above and get the result as total duration time. How it is possible in java? Or is any other way that the desired output can be got from the sql query itself. Appreciate your help.

    JAMon does exactly this and more. Whatever label you pass to the start method later shows up in a report with the times aggregated (hits,total time,avg time, min time, max time and more). jamon is easy to use, open source and fast. For servlets you can use the jamon servlet filter and monitor these stats for each servlet without any code changes on your end (just add to your web.xml and make jamon.jar available).
    jamon 2 was just released this weekend and it has some new powerful capabilities.
    Having said that I would think your particular case would be better solved by the database with a group by clause.
    http://www.jamonapi.com
    Something like the following could work. Note I am also timing the code with jamon.
    import com.jamonapi.*;
    Monitor mon=MonitorFactory.start("myCode");
    long totDuration=0;
    String masterquery = new StringBuffer("SELECT max(TSIE52_SESSION_DURATION)  from STSIE52_USER_SESSION ").toString();
    ResultSet subResultSet = getResultSet(connection, masterquery);
    while (subResultSet.next()) {
    parseFinalTime = sdf.parse(subResultSet.getString(1));
    MonitorFactory.add("totalDuration", "duration",totDuration);
    mon.stop();

  • Predict Trip time duration from Pick up and Drop off Latitude and Longitude using Azure ML Studio

    I'm using Microsoft
    Azure Machine Learning Studio to create an experiment for predicting
    time duration of a trip by using
    a data set containing previous records of the trip time along with latitude and longitude of the pick up and drop off location.
    Can anyone help me out with whatregression model (or
    R-Script optional) should I use to train my model?

    Hi,
    Are you training with raw latitude/longitude? If so, you should try clustering the start/end points into groups. An easy way to do this is to take a decimal or two off the values. Otherwise, the algorithm is seeing
    many, many, unique pairs which may degrade the model performance.
    You will probably also want to use the
    Learning with Counts modules to summarize that lat/lon data because even with clustering, the features will still have high dimensionality. Here's some info on learning with counts:
    http://blogs.technet.com/b/machinelearning/archive/2015/02/17/big-learning-made-easy-with-counts.aspx
    Also, we did some experiments on similar data so if you want to read more about that see:
    http://blogs.technet.com/b/machinelearning/archive/2015/04/02/building-azure-ml-models-on-the-nyc-taxi-dataset.aspx
    Hope this helps!
    Margaret

  • How can I trig a timer to start to run for specific time duration?!

    Hi,
      I have a SubVI which gives me a string line, and I need that after end of this line ( which I gives me true value),  trig a timer to start to run to make the loop to wait for specific time duration. here I attached my VI, I hope it is clear.
    anybody can help me ?!
    Attachments:
    Sample Measurement.vi ‏45 KB

    worldviol wrote:
    Hi,
      I have a SubVI which gives me a string line, and I need that after end of this line ( which I gives me true value),  trig a timer to start to run to make the loop to wait for specific time duration. here I attached my VI, I hope it is clear.
    anybody can help me ?!
    can you be more specific?.....is the string coming from your "serial1.vi"? and what string specifically are you looking for to make this event happen?
    start by looking at the "comparison" pallet for your T/F logic of what specific string you want, wired to your case statement and a timer....

  • Incorrect time duration for songs

    I just added a few mp3s to my iTunes (8.1.1) library, and while the songs are around 3-4 minutes long each, the time duration listed is more than 25 minutes for each of the songs. The songs play fine, and they stop at the proper point (3-4 minutes in), the length is just listed wrong... how can I fix this? It's messing with my total time count, and it's just rather annoying altogether. Thanks for any help!

    Welcome to the forums
    One thing you could do, is set the correct Stop time for the track (in Get Info), and the track will stop playing at the correct point.
    If you want to make the total time correct also, then :
    1. set the correct Stop time (above)
    2. convert the MP3 (iTunes Preferences / Importing) to another format, or to MP3 again (you will lose a little quality I'm afraid)
    The converted track will now have the correct Stop time AND length.

  • How to set waveform time duration in labview

    please can anyone help me with how to set the waveform time duration in labview (for real time monitoring and measurement). i need to monitor the system in waveform chart with the time duration 10:00AM TO 4:00PM with the appropriate date. i  urgently need any useful information. thanks 

    If you are trying to manipulate the waveform data itself, look in to the Get Waveform Subset VI.
    If you are trying to alter the chart to show a specific section of the data, look in to the Chart's properties using a property node. Specific properties you want are XScale and YScale values.
    And like Dennis said, please provide what you've been trying to do. This makes it easier to help.

  • Can u give clear steps how to load 3 data target at a time by the help of p

    can u give clear steps how to load 3 data target at a time by the help of parllalesim

    hi,
    create the load infopackage type and give the infopack you need to load.
    create 3 similar process types.
    chain should have this flow
    start -> delet index(if cube is the target) -> load target(connect the load process to start process) parallel -> and process -> create index(if cube)/actiavtion of ods(if ods)
    Ramesh

  • I keep on getting this error when i try to copy files to my 2T Time Capsule, Please help im running out of space on my MacBook Pro.... The operation can't be completed because an unexpected error occurred (error code -50)

    I keep on getting this error when i try to copy files to my 2T Time Capsule, Please help im running out of space on my MacBook Pro....
    The operation can’t be completed because an unexpected error occurred (error code -50)

    I would get an external drive today and copy all your stuff off the TC.. forget trying to load more onto it. There is a good chance after 3years (A 2TB should be only about 2years tops), the disk or the TC itself is on the way out. Do it immediately. If TM is also failing to backup you need to recognise symtoms of impending doom.
    Unfortunately the error messages are archane and it is hard to discover their meaning.
    You also cannot verify a network drive.. you can verify the TM sparsebundle though so do that.
    A5. http://pondini.org/TM/Troubleshooting.html
    Reboot the whole network from off.. certainly if you run later OS it can simply lose the drive..
    If you still fail to be able to copy to the TC.. then get that external and copy off it. Tell us if you can do that.

Maybe you are looking for

  • Why??? Simple snapshot can not refresh automatically, but can refresh manually.

    Server 1 : Oracle 7.3.4 (as a Master site) Server 2 : Oracle 7.3.4 (as a Snopshot site) Client PC: SQL*Plus (Oracle 7.3.4 Client) Step 1: on Client PC, start 2 SQL*Plus dialog Windows, one(Window A) for <Server 1> , another(Window B) for <Server 2>;

  • SAP DB Connection from SAP BI on HP UNIX to MS SQL External Database

    Dear All, Greetings! I have a scenario to configure a SAP DB Connection from SAP BI System on HP UNIX 11i to the external legacy system MS SQL 2000 Enterprise for data upload. I am interested in connecting the SQL server as a Source System to the BI

  • Email Sales Order Confirmation to "Created By" -

    Hi Experts I have a requirement where we need to email the Order confirmation output to the person who has created the sales order. So lets say i am creating a sales order and my user id is 9999. (SY-UNAME). Now as we have implemented HR module and o

  • Is it possible to use my Zen for an external hard drive?

    I want to use my zen for a storage device to my PVR. Is there a way to activate it so that it acts like a hard dri've or usb hard dri've when connected? I have the 6gb Thanks!

  • How to align the CSV file on upload?

    Hi All, I have to upload a CSV file as an attachment in a mail and the data's in the internal table which has to be uploaded in the CSV file are seperated using commas which on uploading appear in the CSV file in the same column but i need the data's