Summing and selecting specific date

I have two tables. One is a table of invoice. Thereโ€™s a [PAY] and [PAY TYPE]. I have another table that will sum up for the day. [Pay] is an amount, [Pay Type]= โ€œcreditโ€. I want to create a virtual row that sums up all the credits for the day.
select all with [pay type] = โ€œcreditโ€
sum up [Pay] if [Pay Type] = โ€œcreditโ€ and [date] = today
Can somebody help with the expression?
My guess: sum(select([PAY TYPE] = CREDIT, [PAY], TRUE))

0 6 314
6 REPLIES 6

Well, you got the SUM(SELECT()) portion correct, but that SELECT expression is nowhere near properly formed, give this SELECT article another review:

Youโ€™ll also need this:

Hereโ€™s my actual expression.
SUM(SELECT(FORM RESPONSES 1[PAT PAYMENT],AND([PAY TYPE] = โ€œCreditโ€, Daily Report[APP DATE] = Form Responses 1[App Date], TRUE)))

I want to filter todayโ€™s report( Daily Report[App Date]) with my Datasheet(Form Responses 1[App Date])
It doesnโ€™t work.

For the criteria part, Iโ€™m trying to pull only data from Table 1 that has the same [date] from Table 2. I tried
SUM(SELECT(FORM RESPONSES 1[PAT PAYMENT],AND([PAY TYPE] = โ€œCreditโ€, Daily Report[APP DATE] = Form Responses 1[App Date], TRUE)))

Daily Report[APP DATE] = Form Responses 1[App Date] โ†’ Iโ€™m trying to filter the date from one table with another. Itโ€™s valid but not summing up. Is my first expression wrong?

Ahhโ€ฆ I got it to work with this.

SUM(SELECT(FORM RESPONSES 1[PAT PAYMENT],and([PAY TYPE] = โ€œCreditโ€,[app date] = today()), FALSE))

However, what can I use instead of [app date] = today() ? What if I want to choose another day besides today?

I assume youโ€™re running this expression from the context of a record in your Daily Report Table? Try replacing TODAY() with [_THISROW].[APP DATE]

Top Labels in this Space