Total daily sales report by one user

Hi, How can I show the daily total sales only if this user MJ exist.

[Daily Revenue (Cash Only):1,1,1]
>Date|User|Amount
{REPORT PAYMENT DETAILS:P.Date,P.User,P.Amount.Sum:(PT=Cash)}
>>Total|| {REPORT PAYMENT TOTAL:(PT=Cash)}

[Account Payment Details (Cash Ou:1,1,1,2,1, 1]
>Sales Cash||||{ACCOUNT TRANSACTION TOTAL:Payment Transaction:Cash}
{REPORT ACCOUNT TRANSACTION DETAILS:T.Date.asc,T.Time,T.UserName,T.TransactionName,T.Amount:(ATT= Petty Cash OUT)}
>Totals||||[=F((TN('{ACCOUNT TRANSACTION TOTAL:Petty Cash OUT:Cash}')),'#,#0.00')]

>>Cash End||||[=F((TN('{ACCOUNT DEBIT TOTAL:Cash}')-TN('{ACCOUNT TRANSACTION TOTAL:Petty Cash OUT:Cash}')),'#,#0.00')]
[Daily Revenue (Cash Only):1,1,1]
>Date|User|Amount
{REPORT PAYMENT DETAILS:P.Date,P.User,P.Amount.Sum:(PT=Cash) AND (PU="MJ")}
>>Total|| {REPORT PAYMENT TOTAL:(PT=Cash) AND (PU="MJ")}

We are MJ & (KM not showing on the report) are responsible for cash at end of the day. Lets took 19/04: PU it doesnt help it will show only 260.50. I need to show 441=180.50+260.50 and then min petty cash 20.

[Daily Revenue (Cash Only):1,1,1]
>Date|User|Amount
@MJ,MS,KM
{REPORT PAYMENT DETAILS:P.Date,P.User,P.Amount.Sum:(PT=Cash) AND (PU=$1)}
>>Total|| {REPORT PAYMENT TOTAL:(PT=Cash) AND (PU=$1)}
1 Like

Thank you Posflow, the correct code for me was
@@test

[Transactions by Date:3,2,1,1]
>Date|Number of Transactions|Total Cash Amount
@@test
SELECT 
      CAST(P.[Date] AS DATE) AS [TransactionDate],
      COUNT(*) AS [NumberOfTransactions],
      SUM(P.[Amount]) AS [TotalCashAmount]
FROM [Payments] P
WHERE [Name] = 'Cash'  
GROUP BY CAST(P.[Date] AS DATE) -- 
HAVING MAX(CASE WHEN P.[UserId] = 7 THEN 1 ELSE 0 END) = 1 
ORDER BY [TransactionDate]; -- 

The issue here is the datetime is setting to 00:00:00:00, how can I modify it to closing work periods.