Recent content by DLB

  1. D

    Time

    I would use "s" instead of "n". It won't leave out the seconds. DateDiff("s",[StartTime],[EndTime])/3600*[Rate]
  2. D

    Help with VB syntax

    Have you tested it? How slow do you think it would be for the DLookup function to return the value from a single-row single-field table? And do you think that opening a recordset in VBA will not take time?
  3. D

    Help with VB syntax

    Alternatively, Dim TheValue As String TheValue = DLookup("FieldName", "TableName")
  4. D

    average calculation for Pages Per Hour

    I don't think time less than one hour would be the problem. Jon's sample contained two records with time less than one hour. It would divide by zero only if the StartTime and EndTime are the same. ~
  5. D

    average calculation for Pages Per Hour

    For those who wonder what that is, here is the link:- http://www.access-programmers.co.uk/forums/showthread.php?t=62733 ~
  6. D

    Find the most popular book in a library

    What trucktime means is a Totals Query (click on the Totals button on the toolbar or select menu View, Totals.) In the Totals Query, you don't need to set the Unique Values to Yes. ~
  7. D

    Sum of (calculated)Time

    The expression should be [EndTime]-[StartTime]. You can Sum the expression before formatting:- TotalTime: Format(Sum([PageCounts].[EndTime]-[PageCounts].[StartTime]),"Short Time") If TotalTime is greater than 24 hours, you may find the sample database by Jon K helpful:-...
  8. D

    DMax()?

    After reading this thread, I was interested to find out how Access's help files say about subqueries and found this:- So it seems, in some situations, we can use subqueries to optimize query performance. Is this deduction correct...? I decided to compare Jon K's two-query approach (which...
  9. D

    Calculation Time

    Bind the TotalTime text box to the TotalTime field i.e. change these two properties: Name : TotalTime Control Source : TotalTime Then put this line of code in the After Update event of the EndTime text box: Private Sub EndTime_AfterUpdate() Me.TotalTime = Me.EndTime - Me.StartTime...
  10. D

    LEFT JOIN with selection criteria

    Pat, The poster wanted to include all records from TableA in the results. Using WHERE TableB.fldD = "X" OR TableB.fldD Is Null will exclude those TableA.IDs which exist in TableB.BID but none of whose fldD is equal to "X". For instance, if TableB contains these two records for BID=4: BID...
  11. D

    LEFT JOIN with selection criteria

    You will need to put the join expression in brackets. SELECT tPlayers.ID, tPlayers.LastName, tPlayers.FirstName, tPlayers.Handicap, tPlayers.Status, tPlayers.Comment, tScores.PlayDay, tScores.DayHandicap, tScores.GrossScore FROM tPlayers LEFT JOIN tScores ON (tPlayers.ID = tScores.PlayerID AND...
  12. D

    Group column by day...

    Put this in a column in the query grid: Field: Date: DateValue([DateTimeField]) Total: Group By See the query in the attached database.
  13. D

    Group column by day...

    In the Totals query, you can group by DateValue([yourDateTimefield])
  14. D

    LEFT JOIN with selection criteria

    You can first build a query to pull the records from TableB Where fldD ="X". Then in a second query, left join TableA with the first query. Run the second query.
  15. D

    Calculation Time

    Maybe you will find Jon K's sample here helpful: http://www.access-programmers.co.uk/forums/showthread.php?t=62733 ~ In fact, it did give you a related amount of time in a double precision number. All you needed was to format it properly. See the Medium Time format of the "txtTotalTime"...
Back
Top Bottom