Google Sheets Query - Group by more than one column without a pivot table

I have a timesheet dataset containing 4 columns:

Column 1 - A workers name

Column 2 - The date they worked

Column 3 - The project they worked on

Column 4 - The hours they worked on that date, on that project.

Eg

I'm just starting to learn about the QUERY function and I hope it is possible to group the lines by two columns - Name and Date - and sum the hours, regardless of the Project, worked on each date, and end up with a table like this:

So far I've just learned how to group by a single columns values. I'm not looking for a pivot table (at least I don't think I am) because I need to be able to use the resulting table to compare with another table (attendance data) and I think it will be easier if I keep the timesheet records on a single line.

You can group by more than one columns in a query. You do not need a pivot table for that.
On the other hand, when using pivot in your query, the results will be presented in different ways.

Without a pivot

=QUERY(A1:D9, "select A, B, sum(D) group by A, B label sum(D) 'Hours' ",1)

Using a pivot

=QUERY(A1:D9, "select B, sum(D) group by A pivot B label sum(D) 'Hours' ",1)

OR

=QUERY(A1:D9, "select B, sum(D) group by B pivot A label sum(D) 'Hours' ",1)

• Apologies for the delayed response, and thanks for providing the correct answer @marikamitsos Commented Feb 18, 2020 at 9:18
• Glad it worked out. Commented Feb 18, 2020 at 14:34
• Note that the two formulas under "Using a pivot" are identical. I think that in the first line group by B pivot A is meant to be group by A pivot B. Commented Jan 16, 2021 at 19:22
• Thank you for the heads up @AnthonyHolland. It is now fixed. Commented Jan 17, 2021 at 17:40