Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL columns
Message
From
21/10/1997 17:08:48
Elyse Pomerantz
Dynamic Data Concepts, Inc.
Brooklyn, New York, United States
 
 
To
21/10/1997 16:04:33
Ian Johnston
Computer Software Solutions
Woodland, California, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00055848
Message ID:
00055869
Views:
28
>I am trying to build a view that totals an amount filed, I wish to have one column total be a YTD total and another column for just a particular day. I have tried using a join but that gives two rows for the result, I need one row with both totals.
>
>TIA
>
>Ian

How about something like:

SELECT cCommodity,sum(nAmount) as YTD, sum(iif(dDate=date(),nAmount,0)) as Today FROM YourTable GROUP BY 1

HTH
Elyse
Elyse Pomerantz
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform