Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Simple query question
Message
From
19/12/1997 12:19:37
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00067216
Message ID:
00067229
Views:
14
>I have a simple query question. I know that I've done this before, but for the life of me I can't remember. I must have a brain cloud today.
>
>Table with two fields to be included in the query output: Date, Amount
>Hundreds of transactions for each day.
>
>I want to do a query with the end result being the total amount for each date.
>My first crack at this was to create a query grouping the Date field and having the expression sum(amount). This gave me numbers that were way out of whack.
>
>Here is the SQL from the existing query:
>
>SELECT Orders.date, SUM(Orders.total);
> FROM cash!orders;
> GROUP BY Orders.date;
> ORDER BY Orders.date;
> INTO TABLE ted1.dbf
>
>What am I missing?
Hi,
Try
SELECT Orders.date, SUM(Orders.total);
FROM cash!orders;
GROUP BY 1
INTO TABLE ted1.dbf && Maybe cursor better
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform