MOD 60

  • Thread starter Gaetanm via AccessMonster.com
  • Start date
G

Gaetanm via AccessMonster.com

Can I use MOD 60 in a querie I have Stopdate and Startdate and trying to get
my TotalTime to have Hours and Minutes. I acn get Hours but when I use
Mod 60 it doe not work when I test the querie. This is what I'm using in the
field

ToTalTime: (DateDiff("n",[Startdate],[Stopdate]))\60 Mod 60 "\:00"

Can You help


Gaetanm
 
J

John Vinson

Can I use MOD 60 in a querie I have Stopdate and Startdate and trying to get
my TotalTime to have Hours and Minutes. I acn get Hours but when I use
Mod 60 it doe not work when I test the querie. This is what I'm using in the
field

ToTalTime: (DateDiff("n",[Startdate],[Stopdate]))\60 Mod 60 "\:00"

Can You help


Gaetanm

Sounds like you're using the syntax of the Format() function without
including the function. Try

TotalTime: ToTalTime: DateDiff("n",[Startdate],[Stopdate])\60 &
Format(DateDiff("n",[Startdate],[Stopdate]) Mod 60, "\:00")

This will calculate the hours first - integer dividing the datediff
result by 60 and then formatting the remainder minutes with a
preceding colon.

John W. Vinson[MVP]
 
G

Gaetanm via AccessMonster.com

John said:
Can I use MOD 60 in a querie I have Stopdate and Startdate and trying to get
my TotalTime to have Hours and Minutes. I acn get Hours but when I use
[quoted text clipped - 6 lines]

Sounds like you're using the syntax of the Format() function without
including the function. Try

TotalTime: ToTalTime: DateDiff("n",[Startdate],[Stopdate])\60 &
Format(DateDiff("n",[Startdate],[Stopdate]) Mod 60, "\:00")

This will calculate the hours first - integer dividing the datediff
result by 60 and then formatting the remainder minutes with a
preceding colon.

John W. Vinson[MVP]

Thanks John that works great. I'm new at this and strugling through. I can
use that
code to get what I want displayed but can you assist me in changing this to
where
I need the minutes to show in 1/100th of an hour for billing purposes

Gaetan
 
J

John Vinson

I need the minutes to show in 1/100th of an hour for billing purposes

I don't understand. Could you give an example of what you want to see?
Minutes ARE sixtieths of an hour - what do you mean by "display as"?


John W. Vinson[MVP]
 
G

Gaetanm via AccessMonster.com

John said:
I don't understand. Could you give an example of what you want to see?
Minutes ARE sixtieths of an hour - what do you mean by "display as"?

John W. Vinson[MVP]

John

Presently the datediff shows time as hours and minutes which I can display
on a form
to show the total time worked to date. 33hours and 50 minutes

For billing purposes the 3 hours and 50 minutes are represented by
33.83 X the billing rate another example 15 minutes is .25

A good example of a 100th hour table is located at
http://www.finance.ohiou.edu/financials/100thHourTable.htm
 
J

John Vinson

John

Presently the datediff shows time as hours and minutes which I can display
on a form
to show the total time worked to date. 33hours and 50 minutes

For billing purposes the 3 hours and 50 minutes are represented by
33.83 X the billing rate another example 15 minutes is .25

A good example of a 100th hour table is located at
http://www.finance.ohiou.edu/financials/100thHourTable.htm

Then store or calculate the time worked as Long Integer minutes, using
DateDiff("n", [start time], [end time]); divide that value by 60 to
get fractional hours. You can use Round([duration] / 60, 2) to round
to two decimals.

Use the MOD expression just for display purposes.

John W. Vinson[MVP]
 
G

Gaetanm via AccessMonster.com

John said:
[quoted text clipped - 14 lines]
A good example of a 100th hour table is located at
http://www.finance.ohiou.edu/financials/100thHourTable.htm

Then store or calculate the time worked as Long Integer minutes, using
DateDiff("n", [start time], [end time]); divide that value by 60 to
get fractional hours. You can use Round([duration] / 60, 2) to round
to two decimals.

Use the MOD expression just for display purposes.
John Thanks again I created another column in my table and put the Round (
[Column Name] /60,2)
in my query and got the second half of my calculation. Thanks again for your
promptness
and expertize. Now that victory is done let me go back and work on this issue.

"Run-time error 438 Object Doesn't support this property or method"

Thanks again

Gaetanm
 
J

John Vinson

Now that victory is done let me go back and work on this issue.

"Run-time error 438 Object Doesn't support this property or method"

What's triggering this message?

John W. Vinson[MVP]
 
G

Gaetanm via AccessMonster.com

Gaetanm said:
[quoted text clipped - 8 lines]
Use the MOD expression just for display purposes.

John Thanks again I created another column in my table and put the Round (
[Column Name] /60,2)
in my query and got the second half of my calculation. Thanks again for your
promptness
and expertize. Now that victory is done let me go back and work on this issue.

"Run-time error 438 Object Doesn't support this property or method"

Thanks again

Gaetanm
John W. Vinson[MVP]
John
Hope this is not too winded but I tried to give has much information as
possible
I have a form called Clock_Stop_Table
The purpose of this form is to UPDATE a existing record in the
Clock_Table

It consist of 4 fields and 2 buttons

ComboBox with the query [Jobs not Completed] that’s made up of 3 linked
tables.

EmployeeId, FirstName, LastName, JobID, Notes, StartDate,
StopDate
Number Number Txt
Date/Time Date/Time

Is Not NULL Is Null



2 text boxes
JobID Lable =EmployeeId.Column(4) {deleted Lable} =EmployeeId.Column(5)


StopDate This Field is populated by a button [Input Stop Time}

Date/Time


The Input Stop Time button states:

Private Sub Command4_Click()
Me.StopDate = Now
End Sub

Now is where I think I’m getting into trouble !

This button should UPDATE the table called Clock_Table the table has the
following:

JobID EmployeeId StopDate StartDate
Number Number Date/Time DateTime

Here is the Code for the button:

Private Sub Command21_Click()

Dim SQLstrg As String

SQLstrg = "UPDATE Clock_Table SET [StopDate] = #" & Me.StopDate & "# WHERE ((
[StopDate] Is Null) And ([EmployeeID] = " & Me.[EmployeeID].[Column(0)] & "))
;"

End Sub
After clicking the button I get

"Run-time error 438 Object Doesn't support this property or method"

Thanks for your help
Gaetan
 

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

Similar Threads


Top