We help IT Professionals succeed at work.

Need help with Writing a Progress Query

csimmons1324
csimmons1324 asked
on
Medium Priority
1,076 Views
Last Modified: 2013-12-25
I need to make some mass changes to a database and I need some help with writing a Progress Query.  I need to set the price to 0 for Product Group 0501 thru 6501 and set the effective date as 2/1/2008.  I have attached the code to do this and the code works perfect.  

However, this time around I need to change the items with a Product Code of 0501 thru 6501 AND have and effective date prior to 8/1/2007 to have a price of 0 and set the effective date to 2/1/08.  This would leave all the prices and effective dates intact for items entered on and after 8/1/07.

Can someone help me with the Syntax to add this to the criteria used to change prices?

Thanks,

Chris
/* program to update price and date information */
for each vas.item no-lock where
item.product-code >= "0501" and
item.product-code <= "6501":
 
  for each vas.itemprice exclusive-lock where
  itemprice.item = item.item:
    assign
    itemprice.unit-price1 = 0
    itemprice.effect-date = 2/1/2008.
  end. /* itemprice update loop */
 
end. /* item table loop */

Open in new window

Comment
Watch Question

Commented:
/* program to update price and date information */
for each vas.item no-lock where
item.product-code >= "0501" and
item.product-code <= "6501":
 
  for each vas.itemprice exclusive-lock where
  itemprice.item = item.item and
   itemprice.effect-date <8/1/2007 :
    assign
    itemprice.unit-price1 = 0
    itemprice.effect-date = 2/1/2008.
  end. /* itemprice update loop */
 
end. /* item table loop */
csimmons1324IT Manager

Author

Commented:
That worked great!  Thanks for all the help!

Explore More ContentExplore courses, solutions, and other research materials related to this topic.