Summing fields in two ways
From: Kardos Balázs (kab_at_cowi.hu)
Date: 05/04/04
- Next message: dk: "Sql server does not exist or access denied"
- Previous message: Mary Chipman: "Re: Password Required on Open of Linked Access mdb file"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 4 May 2004 05:34:36 -0700
Hi!
Could anybody help me, how to sum up a column two ways in
one query. I mean:
Code Date(M.D) Weight
EUT 05.15 0,5
COM 05.16 8
COR 05.21 2
SAR 05.22 1
SAR 06.03 0,5
COM 06.03 6
EUT 06.16 6,5
COR 06.16 1
Now I would like to make a query, in which I can sum ip
weights for the whle period and for just the month June.
Code Sum(whole period) Sum(just in June)
EUT 7 0,5
COM 14 6
COR 3 6,5
SAR 1,5 1
I tried with the following code (another tables):
SELECT `Sheet1$`.F1, Sum(`Sheet1$`.F4) AS 'Sum all', CASE
When `Sheet1$`.F3>{ts 2004-04-01 00:00:00} THEN Sum(`Sheet1
$`.F4) ELSE 0 END
FROM...
WHERE...
GROUP BY `Sheet1$`.F1
But CASE WHEN statement does not work in MSQuery (in an
Excel Query Table).
The error message was: `Sheet1$` cannot be after SELECT
(syntact error - wrong formula).
Could anybody help me, where can I find informarion about
MSQuery language opportunities?
Thanks:
pontitt
- Next message: dk: "Sql server does not exist or access denied"
- Previous message: Mary Chipman: "Re: Password Required on Open of Linked Access mdb file"
- Messages sorted by: [ date ] [ thread ]