|
I would like to summarize some fields based on the year and month of a date type field. SQL allows me to use: "Select year(datefield),month(datefield),numeric1 from file" but will not allow me to use "Select year(datefield),month(datefield),sum(numeric1) from file group by year(datefield),month(datefield)". I have tried using "group by 1,2" and using the "as" clause to name the fields yearfield and monthfield to no avail. I know I can create an intermediate file with the year and month fields and then get the totals from that, but it seems like there should be a way to do this without the extra step. By the way, I also tried something from the archives to the effect of: "with temp as (select year(datefield),month(datefield)..." but my system didn't like the "with". We are on V4R1. Any help will be greatly appreciated. Donald R. Fisher, III Project Manager The Roomstore Furniture Company (804) 784-7600 extension 2124 DFisher@roomstoreeast.com
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.