|
Rob, Thanks. Your adjustments seem to have gotten it. Showcase is a GUI animal but sometimes it's better / quicker / easier just to edit the underlying SQL statement. My knowledge of SQL has gotten much better over the past year but I'm not completely fluent in it yet. We do have STRSQL but since this works in Showcase that's all that I really need for the moment. I was suggesting green-screen in case that would be easier for some to relate to. If I need to convert from Showcase to iSeries then I'll manually change the dots to slashes. (When in Rome...) Dave rob@xxxxxxxxx Sent by: To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx> midrange-l-bounces@m cc: idrange.com Subject: Re: Summary results in SQL 11/01/2006 12:08 PM Please respond to Midrange Systems Technical Discussion Do you have STRSQL? If so, the only issue you might have is the dot versus the slash (V40BPCSF.ITHL15) or (V40BPCSF/ITHL15). You can change this in STRSQL, F13=Services, 1. Change session attributes, Naming convention (read the help on that field). If no STRSQL, you can test this by using iNav. Drill down into Databases, system name, Schemas. Once you open up schemas, you can select "Run an SQL script" from the window at the bottom. Wait. I just tried that for you. You are using variables. That's a little trickier to test in STRSQL or iNav. You'll have to put values in there for testing. Or you can whip up a little imbedded sql rpgle program (providing you have CRTSQLRPGI). In imbedded sql you have to replace the & with a colon. And, since you'll be retrieving multiple rows, use a cursor. Need some samples? Rob Berendt -- Group Dekko Services, LLC Dept 01.073 PO Box 2000 Dock 108 6928N 400E Kendallville, IN 46755 http://www.dekko.com rob@xxxxxxxxx Sent by: midrange-l-bounces@xxxxxxxxxxxx 11/01/2006 11:59 AM Please respond to Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx> To Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx> cc Subject Re: Summary results in SQL Sort of like: SELECT TPROD, sum(TQTY) as TotalQty, sum(TQTY * TSCST) AS TotalCost FROM V40BPCSF.ITHL15 ITH WHERE TWHS IN( '11', 'HT' ) AND TTDTE BETWEEN &TTDTE1 AND &TTDTE1 AND TQTY <> 0 AND TTYPE IN( 'M', 'PR' ) AND TPROD BETWEEN &TPROD2 AND &TPROD2 AND TLOCT IN( 'INXT', 'RMDI', 'DWIP' ) GROUP BY tprod Rob Berendt -- Group Dekko Services, LLC Dept 01.073 PO Box 2000 Dock 108 6928N 400E Kendallville, IN 46755 http://www.dekko.com daparnin@xxxxxxxxxxxxxx Sent by: midrange-l-bounces@xxxxxxxxxxxx 11/01/2006 11:31 AM Please respond to Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx> To midrange-l@xxxxxxxxxxxx cc Subject Summary results in SQL This is the select statement for a Showcase query that's pulling data from the iSeries. On a typical green-screen query you can select summary or detail data from the "Select output type and output form" option. Can that be done with SQL? Basically, we just want to see a part number, the total quantity, and the total of the cost * quantity. If it helps, forget Showcase; how would you do this in green-screen SQL? SELECT DISTINCT TPROD, TQTY, TQTY * TSCST AS COLUMN0000 FROM V40BPCSF.ITHL15 ITH WHERE TWHS IN( '11', 'HT' ) AND TTDTE BETWEEN &TTDTE1 AND &TTDTE1 AND TQTY <> 0 AND TTYPE IN( 'M', 'PR' ) AND TPROD BETWEEN &TPROD2 AND &TPROD2 AND TLOCT IN( 'INXT', 'RMDI', 'DWIP' ) Dave Parnin -- Nishikawa Standard Company Topeka, IN 46571 daparnin@xxxxxxxxxxxxxx -- This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/midrange-l or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/midrange-l. -- This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/midrange-l or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/midrange-l. -- This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/midrange-l or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 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.