Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL where problem
Message
From
26/09/1997 22:57:49
 
 
To
24/09/1997 10:12:32
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00051392
Message ID:
00051914
Views:
27
>I would like to use sql to calculate the sum(SomeField) but broken >down by >Jan-March , April-June , July-Sept and Oct-Dec. > >Do I need four seperate sql statements and then merge the tables >together. SELECT {field stuff}, floor((month(date_required)-1)/3) as month_base ; FROM {table stuff} GROUP BY month_base This takes the month, subtracts 1, divides by 3, and gets the lower integer. Here's a table of the results: 1 -> 0 2 -> 0 3 -> 0 4 -> 1 5 -> 1 6 -> 1 7 -> 2 8 -> 2 9 -> 2 10 -> 3 11 -> 3 12 -> 3
Paul Russell
EMail: prussell@fox.nstn.ca
Phone: (902) 499-5043
Previous
Reply
Map
View

Click here to load this message in the networking platform