Forum Discussion

Zack007's avatar
Zack007
Frequent Visitor
3 years ago
Solved

If condition with time duration

Hello,

Please help to have this duration negative calculation in the query, in Excel I used to use the function below.

The first is excluded from the sum of durations and automatically gets that -100 ( by default )to be identified as it was excluded

If I keep both lines as it is the sum of the two values 6:11:39 (Not correct) instead of 0 which is correct.

 

PS: It is a database extraction that I use in a daily manner. 

 

 

 Thank you 😊

 

  • table is the table name, you can change it to your table name and have a try.

10 Replies

  • Zack007's avatar
    Zack007
    Frequent Visitor

    Hello,

     

    As the forum's body does not support either .csv or .xlsx files, you could find below a part of the extraction as a table.

     

    CorrectionUserNamePrd. orderOrder descr. (PO)Operation No.Operation Descr.Operation versionMachine No.Machine descr.FromUntilCapacity [%]Duration [h]Booking type
    1Z003R91EEl Harchaoui, Said5.1E+09GP47567200-00701100-Demolding/Aux mat removal1LEWEB132G132 Leading Edge Web04-12-22 22:1105-12-22 1:17-100,003:05:49Production time
    0Z003R91EEl Harchaoui, Said5.1E+09GP47567200-00701100-Demolding/Aux mat removal1LEWEB132G132 Leading Edge Web04-12-22 22:1105-12-22 1:17 3:05:50 
    0Z003R91EEl Harchaoui, Said5.1E+09Meeting00-0060break1XW132_PSG132 Prefabs Shells NP-NR05-12-22 1:1705-12-22 2:05 0:48:45 
    0Z003R91EEl Harchaoui, Said5.1E+09GP47567200-00701100-Demolding/Aux mat removal1LEWEB132G132 Leading Edge Web05-12-22 2:0505-12-22 4:31 2:25:46 
    1Z003R91EEl Harchaoui, Said5.1E+09GP47567200-00701100-Demolding/Aux mat removal1LEWEB132G132 Leading Edge Web06-12-22 22:1307-12-22 3:36-100,005:22:52Production time
    0Z003R91EEl Harchaoui, Said5.1E+09GP47567200-00701100-Demolding/Aux mat removal1LEWEB132G132 Leading Edge Web06-12-22 22:1307-12-22 3:36 5:22:53 
    0Z003R91EEl Harchaoui, Said5.1E+09Meeting00-0240Waiting Due To Crane Movements1XW132_PSG132 Prefabs Shells NP-NR07-12-22 3:3607-12-22 5:54 2:17:59 
    0Z003R91EEl Harchaoui, Said5.1E+09Meeting00-0010Meeting1XW132_PSG132 Prefabs Shells NP-NR07-12-22 22:0207-12-22 22:04 0:01:53 
    1Z003RJZCOu Taleb, Mohamed5.1E+09GP47568400-0030700-Lay up1S_CAP132G132 Suction Cap05-12-22 7:4305-12-22 11:43100,004:00:05Production time
    1Z003RJZCOu Taleb, Mohamed5.1E+09GP47568400-0030700-Lay up1S_CAP132G132 Suction Cap05-12-22 7:4305-12-22 13:51-100,006:08:06Production time
    0Z003RJZCOu Taleb, Mohamed5.1E+09GP47568400-0030700-Lay up1S_CAP132G132 Suction Cap05-12-22 7:4305-12-22 13:51 6:08:06 
    0Z003RJZCOu Taleb, Mohamed5.1E+09Meeting00-0010Meeting1XW132_PSG132 Prefabs Shells NP-NR06-12-22 5:5606-12-22 8:57 3:00:59 
    1Z003RJZCOu Taleb, Mohamed5.1E+09GP47568400-0020600-In-line preparation1S_CAP132G132 Suction Cap06-12-22 8:5706-12-22 13:41-100,004:43:07Production time
    0Z003RJZCOu Taleb, Mohamed5.1E+09GP47568400-0020600-In-line preparation1S_CAP132G132 Suction Cap06-12-22 8:5706-12-22 13:41 4:43:07 

     

      • Zack007's avatar
        Zack007
        Frequent Visitor

        Hello,

        Column N is [[ Duration [h] ]], Column M is [[ Capacity [%] ]].

        Many Thanks