I have a form which shows training events - these can take place over one or several days, and can be run by one trainer or several, so I have my basic Events Info in one table (EventID, EventType, Location, that kind of thing) and the 'Jobs' in a separate table (EventID, JobDate, TrainerID...
ok there must be something different in your settings, as mine shows decimals.... eg 1.50, 4.00, 6.25... then again, I was just doing the calculation in a query rather than in SQL...
When you say you want it in decimal format - do you mean you would want 30 mins to show as 0.50, and 45 mins as 0.75 ?
Because if that's the case, surely it's dead easy?
ActualManHours=format((txtEndTime-txtStartTime)*24,"standard")
An Aggregate function is normally when you group by something, and then work out the sum, or average, or count, or max / min etc of something else based on what you've grouped on.
For example, if you wanted to work out the number of Orders a company had placed - you could group by the company...
As Paul said, that's not an aggregate function, it's just a calculation - so you should be able to just replace your WHERE statement with
WHERE (((([tblBalances].[Amount]*[tblRates].[FXRate]))>1000) AND ((tblBalances.[BalanceDate])=#12/10/2013#));
Admittedly, it's harder to maintain and easier to get the syntax wrong, but for someone not familiar / comfortable with writing code, potentially quicker.... just wanted to offer it up as an alternative ;)
never even thought about it, Paul... just carried on using Now as that's what had been used earlier in the thread!
Wrists duly slapped and earlier post being edited ;)
In a query, you could try
Yrs: IIf([Establishedyear]<1981,Year(Date())-1981,Year(Date())-[Establishedyear])
Points: IIf((Year(Date())-[Establishedyear])<10,(Year(Date())-[Establishedyear])*2,20+((Year(Date())-[Establishedyear]-10)))
try this....
it could probably be done in a more streamlined way as this needs all 3 queries.... just import them all into your database ;) and then run qryBandsEarningsPerMember
THis may not give you the whole solution but maybe it'll point you in the rigt direction?
Assuming your controls are txtCommenceDay and txtFinalDay:
Private Sub txtFinalDay_AfterUpdate()
If Not IsNull(Me.txtFinalDay) And Me.txtFinalDay< Me.txtCommenceDay Then
MsgBox "Final...
screen.activecontrol = the control on the screen that's currently active - in this case. my cboTrainer (combo box)
So it looks for the value that I've just selected in the combo... just makes it easier if you forget and rename the control afterwards ;)
I have this on one of my forms, and it works.... it's on the cboTrainer_AfterUpdate
Private Sub cboTrainer_AfterUpdate()
Form.Filter = "[TrainerID] = " & Str(Nz([Screen].[ActiveControl], 0))
Form.FilterOn = True
End Sub
Question: why are you storing both the City and Province in your Installations table?
You'd be better adding a unique ID to the Cities table, maybe calling it CityID, and then storing that in the Installations table - you can then lookup / display up the City and Province using the CityID...
Depends what is being stored as the mileage on each date? If it's the Odometer reading, then you should be able to just take the reading on the 'entered date' away from the reading 28 days after.....
But if it's how many miles driven since the last reading, then yes, they'll need to sum them :)