Diff of hours from begin month to end month

N

NeoFax

I want to have a query that shows the difference in hours from the
beginning of the month to the end of the month. This shows the months
production output. I will then build a crosstab query on this to show
month on month production output to see if we are gaining or losing
production capability.
 
J

John Spencer

IF you mean you want to show the number of hours in a month then you can use
the DateDiff function.

DateDiff("h",#1/1/2008#,#1/31/2008#)

I suspect you need something a bit more complex then that, but you haven't
given enough details to propose a more detailed solution. So I hope the
above will help get you started on a solution.

--
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
N

NeoFax

IF you mean you want to show the number of hours in a month then you can use
the DateDiff function.

DateDiff("h",#1/1/2008#,#1/31/2008#)

I suspect you need something a bit more complex then that, but you haven't
given enough details to propose a more detailed solution.  So I hope the
above will help get you started on a solution.

--
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
.






- Show quoted text -

Sorry for not responding earlier! It is more complex than that.
Currently I have a query that imports information from SAP and then
appends the hour information into a table. The table looks like
below:

Helo Hours Hours Worked Date Workcenter Month
BeginMonth EndMonth
14701 2554.3 31.2 3/3/2008 3G1FALST
3 31.2
14701 2554.3 12.1 3/3/2008 3G1FALME
3 12.1
14702 2981.5 9.1 3/3/2008 3G1FALEA
3 9.1
...

This info is dumped each day. As you can see, the first workday of
the month is wrote to BeginMonth and the last workday of the month is
written to EndMonth. What I want is to subtract month 3's beginmonth
numbers from month 3's endmonth numbers.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top