Calculating total working hours exclude launch, smoking...and etc times

  • Hi Forum,

    I'm so sorry that I posted the same massage again and again. I'm totally new, and I didn't realize that my posts are getting to the next page. As it didn't show up in the page that I'm writing, I thought it's not posting at all.

    Feel so sorry to make such a mistake.

    I live in East Asia, and times must be totally different, while I post I don't really expect you to answer in hours.

    Anyway, I feel so sorry, that I didn't know the forum rules.

    And BIG THANKS to all, who helped me until now. Really appreciate it.

    And excuse for my bad English

  • Dehqon D. (3/16/2010)


    I'm so sorry that I posted the same massage again and again. I'm totally new, and I didn't realize that my posts are getting to the next page...

    :laugh: Have to love a good misunderstanding :laugh:

    So...you waited half an hour for your post to appear...not for Jeff to respond. I get it.

    Oh dear...lol!

  • Dehqon D. (3/16/2010)


    Hi Forum,

    I'm so sorry that I posted the same massage again and again. I'm totally new, and I didn't realize that my posts are getting to the next page. As it didn't show up in the page that I'm writing, I thought it's not posting at all.

    Feel so sorry to make such a mistake.

    I live in East Asia, and times must be totally different, while I post I don't really expect you to answer in hours.

    Anyway, I feel so sorry, that I didn't know the forum rules.

    And BIG THANKS to all, who helped me until now. Really appreciate it.

    And excuse for my bad English

    Heh... it's plausible and now considering the language barrier, I now understand what you meant by "Reposting 3rd time, after waiting after half hour". Like Paul said, you've just gotta love a blatant misunderstanding... especially on my part. Pardon me while I get the tennis shoe laces out of my mouth.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Finally passed from misunderstandings 😀

    I've created a table to insert a result to a table

    CREATE TABLE [dbo].[Result](

    [Staff No] [nvarchar](50) NULL,

    [Staff Name] [nvarchar](50) NULL,

    [DateIn] [datetime] NULL,

    [DateOut] [datetime] NULL,

    [Duration] [float] NULL,

    [DateNumber] [int] NULL

    ) ON [PRIMARY]

    For insert used the following:

    ...

    Insert into dbo.Result ("Staff No", "Staff Name", "DateIn", "DateOut", "Duration")

    --=== Solve the problem using a self join

    SELECT lo.[Staff No],

    And used this script to convert data

    update dbo.Result

    set DateNumber=CONVERT(varchar(12), DateOut, 112)

    Can anybody help to merge them in one (previous) code.

    Still help is needed to "midnight" splits and sum of data for the date if possible. I'll try the sum to do in CUBE, will inform result later.

    One more thing, this data is dynamic. Can we change the order of insert to database as every day there is new data. Or is it OK it overwrites database everyday?

    Thanks

    It's taking too long for me as well, as I got many different tasks to do except this project

Viewing 4 posts - 16 through 18 (of 18 total)

You must be logged in to reply to this topic. Login to reply