Subject: | Re: What does this do
| Date: | Fri, 26 Feb 2021 01:43:43 +1000
| From: | Bernie van't Hof <onrequest@somewhere>
| Newsgroups: | pnews.paradox-dos
|
Thanks. That's what I thought.
I'm struggling a bit with multi-row queries.
'test' is phpunit test for QBE->SQL converter.
Currently generating:
SELECT DISTINCT
`A/C#` AS `A/C#`,
`MyRef` AS `MyRef`,
`Dr` AS `Dr`,
SUM(`Cr`) AS `Sum of Cr`
FROM
`fuzzy`.`Debtor`
WHERE
(`Cr` = '' OR `Cr` IS NULL)
AND (`Dr` = '' OR `Dr` IS NULL)
GROUP BY
`A/C#`,
`MyRef`,
`Dr`
ORDER BY
BINARY `A/C#`,
BINARY `MyRef`,
`Dr`,
`Sum of Cr`
Which I think is as you say.
On 25/2/21 8:02 pm, modridirkac wrote:
> If it has been working for 30 years, you don't need a test. :)
>
> Calculate sum for all rows, where Cr and Dr are the same?
>
> Match:
> A B 1 blank
> A B blank 1
>
> Not a match:
> A B 1 blank
> A B blank 2
>
>
> On Thu, 25 Feb 2021 02:32:15 +0100, Bernie van't Hof
> <onrequest@somewhere> wrote:
>
>> This one's been working for 30+ years but I can't write a unit test
>> until I know exactly what it is meant to be doing:
>>
>> Query
>>
>> Debtor | A/C# | MyRef | Dr | Cr |
>> | check _a | check _m | check _r | blank |
>> | _a | _m | blank | _r, calc sum |
>>
>> Endquery
>>
>>
>> Any ideas?
>>
>>
>
>
|