|
I don't have this worked out yet, but is this kind of what you are thinking: UPDATE ROB/FELKER SET (case when current month= 1 then SAL01 = :MYVAR when current month= 2 then SAL02 = :MYVAR when current month= 3 then SAL03 = :MYVAR END) Rob Berendt -- Group Dekko Services, LLC Dept 01.073 PO Box 2000 Dock 108 6928N 400E Kendallville, IN 46755 http://www.dekko.com THarteau@xxxxxxxxxxxxxxxxxx Sent by: rpg400-l-bounces@xxxxxxxxxxxx 03/04/2004 12:52 PM Please respond to RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx> To RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx> cc Subject SQL Update using Variable Field Hi, I can't find anywhere where it says I can't do this, but I'm not sure how to achieve it. I have a file with a sales amount for each month (SAL01,SAL02...SAL12). I want to use an SQL statement to zero the month in all records before updating it. So, instead of UPDATE SALES SET SAL01 = 0, I can replace SAL01 with the field for the appropriate month. Is this kind of thing possible? I found where you can use variables for the order by clause, but nothing like this. <===================================================> Terri Harteau Felker Brothers Corporation **************** "There's no point in being grown up if you can't be childish sometimes." - Dr. Who **************** _______________________________________________ This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-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.