Query to group on Day with sum total on a field & filter on Time but NOT group on the time (1 Viewer)

bignose2

Registered User.
Local time
Today, 19:07
Joined
May 2, 2010
Messages
219
Hi,

I am trying to sum total the two values as below but Grouped per day ONLY, 1 total for the 7th, the 8th etc. etc.
However I need the TmHour to filter the results just between those times
This causes it to no longer be grouped by day but per time hour also.
I just can't work this out, any ideas?
Thanks I/A


1688823563171.png


table below is with the TmHour ticked to show the format (not as above) for the example.
Unticked it still shows the several results per day.

1688823673494.png
 

Attachments

  • 1688823611174.png
    1688823611174.png
    22.8 KB · Views: 50

bob fitz

AWF VIP
Local time
Today, 19:07
Joined
May 23, 2011
Messages
4,727
Replace the "PeriodDate" column with a calculated field and GroupBY that field. Perhaps something like PDate: Format([PeriodDate], "dd/mm/yyyy")
 

bignose2

Registered User.
Local time
Today, 19:07
Joined
May 2, 2010
Messages
219
Hi,

Thank you for your prompt reply

Not helped & can't see why it might?

1688826961386.png



1688826915348.png
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 14:07
Joined
Feb 19, 2002
Messages
43,276
Change the "Group By" to "Where" for the time column.

NEVER Format a date except for display purposes. The Format() function turns a date into a STRING which makes it stop acting like a date for purposes of sorting and comparing. If you need to extract only the date or time part from a date field, use the DateValue() or TimeValue() functions.
 

bob fitz

AWF VIP
Local time
Today, 19:07
Joined
May 23, 2011
Messages
4,727
In light of Pat's advice, which I'm sure will be good advice, Use PDate: DateValue([PeriodDate])
 

bob fitz

AWF VIP
Local time
Today, 19:07
Joined
May 23, 2011
Messages
4,727
In Column "TmHour" the Total row should be set to Where rather than GroupBy. That may be all that is required.
 
Last edited:

bignose2

Registered User.
Local time
Today, 19:07
Joined
May 2, 2010
Messages
219
Hi,
Very many thanks
"In Column "TmHour" the Total row should be set to Where rather than GroupBy. That may be all that is required."
WORKED
I thought I had tried that & actually most of the other sum functions, just to get a dumb value to avoid the GroupBy but I guess not.
Put it back to the original table value, no format or even datevalue & seems to work fine although will keep eye out for the frequent anomaly with uk & us dates dates getting bent out of shape with day & month reversal.
thanks again.
 

bob fitz

AWF VIP
Local time
Today, 19:07
Joined
May 23, 2011
Messages
4,727
Glad you have it working now. Good luck with your project.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 14:07
Joined
Feb 19, 2002
Messages
43,276
"In Column "TmHour" the Total row should be set to Where rather than GroupBy. That may be all that is required."
WORKED
I guess my suggestion to "Change the "Group By" to "Where" for the time column." didn't work:( But as long as Bob confirmed it, that made it work:(
 

Users who are viewing this thread

Top Bottom