Results 1 to 7 of 7
  1. #1
    Join Date
    Mar 2004
    Posts
    128

    Unanswered: Calculation by query

    Hi all,
    I have a table consist of the following fields:
    1. Employee name.
    2. Date.
    3. Work hours
    I want to build a query that calculate the difference of the work hours between two givven days.
    eg. 20/06/2004 has 200 H , 26/06/04 has 500 H the result of the query is 300 H
    please help me
    best regards...

  2. #2
    Join Date
    Sep 2003
    Location
    The extremely Royal borough of Kensington, London
    Posts
    778
    Select sum(hours) - (select sum(hours) from tableA where date = #20/06/2004#)
    from tableA where date = #26/06/2004#
    Bessie Braddock: Winston, you are drunk!
    Churchill: And Madam, you are ugly. And tomorrow, I'll be sober, and you will still be ugly.

  3. #3
    Join Date
    Mar 2004
    Posts
    128

    LPT port

    Thanks for your reply,
    Now, If the givven two days are two textboxes in form.How I can I add
    A textbook that has the difference of the hourse of the two days.
    thanks...

  4. #4
    Join Date
    Oct 2003
    Location
    US
    Posts
    343
    Well you have to do the same query but in a function call. You have to first tell us how the form is going to be used? ie will there be a button which when pressed will give the difference in the third box or what?

  5. #5
    Join Date
    Mar 2004
    Posts
    128

    Calculation query

    The difference between the hours will calculated automatically when I write the two days.
    I can also do that by pressing a botton.
    I want to ask also If I can use the result in another textbox.

  6. #6
    Join Date
    Oct 2003
    Location
    US
    Posts
    343
    yes you can use the result in another textbox.

  7. #7
    Join Date
    Mar 2004
    Posts
    128

    calculation query

    Hi,
    what do you mean by function call. can you give me an example of on my case.
    thanks...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •