difference between two times

does this work for difference between times as well? and what type of field do i use it in e.g. calculated, time/date, number etc
 
Last edited:
Have a play with it and see what happens :) If it doesn't work for straight times, it shouldn't be too difficult to modify Raskew's code to deal with straight times.
 
i cant get it to work i have tried it it a calculated column but it says timeFHNS cant be used there so i tried it in number, text, time and date columns but still nothing, i have changed the "first time/second time" things to my field names an everything else was written the same as in your example.
 
Last edited:
The module timeFHNS returns a value calculated from two fields in your DB, and as such should not be stored in a table, but only used to display a result in either a form or a report.

Calculated fields should in general not be stored;
  1. Why store a value that can be calculated at any time for display purposes?
  2. Unlike Excel, if one of the underlying values changes this will not be automagically reflected in the stored value.
There are a very small number of exceptions to this rule but what you have is not one of those.

Use timeFHNS as the ControlSource for an unbound control to display the result when it is required.
 
so how can i use this function in a query? where/when do i enter the TimeFHNS formula in the query?
 
what program opens this type of file? i have never opened a php file so i need to associate it with a program
 
i thought it was weird too, when i downloaded it said MDB but the file appears as a PhP on my desktop.

EDIT: just got it working will take a better look tomorrow. thanks for your help.
 
i have one quick question i want to write in numbers with a decimal place but when i write in 9.25 it shows up as 9 where can i change this so it shows numbers after the decimal place? i have tried the decimal forward button but it just adds 0's after my number instead of the .25 i put in.
 
In the properties of the field go to the FORMAT tab and set the Decimal Places to 2.
 
where can i find the field properties i have right-clicked the highlighted field but that option isn't there
 
Last edited:
You will find it on the Format Tab of the properties box, for the form.

You will also need to ensure that your field is appropriately formatted (ie. Field size = Single or Double) at the table level, the table will need to be in design view.
 
ok i found it but it is still rounding it up so if i put in 8.20 it rounds it to 8.00 how do i turn off rounding?
 
OK ive got all the formulas working, thanks for all of your help, i just have a few more questions:

1. i need to make a report that calculates the min,max,average hours of attendance but when i go through the report wizard it does a separate min,avg,max calculation for every entry but i need an overall

2. i need to find the mean fees due per week but it does it for every entry not overall

3. i need to group the entries by suburb
 
In the query used for your report select Totals. There will be a Totals row for each column.Use the Total row to Group By, Avg, Min and Max. You will need addiitonal columns to do your Min, Max.

If you have problems upload some test data and your report so that I can give some assistance.
 
OK i have attached some random data showing whats been happening with my actual data, so for question 1 i have to have put in a report all the peoples names and the avg,min,max hours but as you can see in question 1 report it works it out for all of them, for question 2 i have to make a report that has all the peoples names and finds avg fees but again in question 2 report it works them out separately. where am i going wrong?
 

Attachments

Last edited:
1. i need to make a report that calculates the min,max,average hours of attendance but when i go through the report wizard it does a separate min,avg,max calculation for every entry but i need an overall

2. i need to find the mean fees due per week but it does it for every entry not overall

3. i need to group the entries by suburb

What I meant was upload some sample raw data from the table that you are using for your queries then I will be able to help you with your grouping. The sample data in your previous response only had one entry per name.
 

Users who are viewing this thread

Back
Top Bottom