Feb 7, 2005 #1 staleb Programmer Feb 7, 2005 45 NO HI I have several products: A,B,C.... their table consists of Name, Price and date The Date tells u from when the price is efective How would I find the efective price for any given date entered by the user?
HI I have several products: A,B,C.... their table consists of Name, Price and date The Date tells u from when the price is efective How would I find the efective price for any given date entered by the user?
Feb 7, 2005 1 #2 lbass Technical User Feb 9, 2002 32,816 US Create a parameter {?effectivedate} and then go to report->edit selection formula->record and enter: {table.date} = {?effectivedate} This will return only those records that match your parameter date, along with the corresponding price. -LB Upvote 0 Downvote
Create a parameter {?effectivedate} and then go to report->edit selection formula->record and enter: {table.date} = {?effectivedate} This will return only those records that match your parameter date, along with the corresponding price. -LB
Feb 7, 2005 Thread starter #3 staleb Programmer Feb 7, 2005 45 NO I dont think this will work. Then they have to enter the exact date. Bur I want them to be able to enter any date If I have a Product A And a table like this for the product: Product Price Efectivedate A 5,00 01/01/2004 (dd/mm/yyyy) A 5,50 01/03/2004 A 6,10 01/10/2004 And if the user enters a date like: 05/05/2004 He would get the price 5,50 Upvote 0 Downvote
I dont think this will work. Then they have to enter the exact date. Bur I want them to be able to enter any date If I have a Product A And a table like this for the product: Product Price Efectivedate A 5,00 01/01/2004 (dd/mm/yyyy) A 5,50 01/03/2004 A 6,10 01/10/2004 And if the user enters a date like: 05/05/2004 He would get the price 5,50
Feb 7, 2005 #4 lbass Technical User Feb 9, 2002 32,816 US Okay, now I see. Group on {table.product} and then change the record selection formula to: {table.date} <= {?effectivedate} Then go to report->edit selection formula->GROUP and enter: {table.date} = maximum({table.date},{table.product}) This will give you the most recent record that is less than or equal to the parm date, and therefore, the current price at that time. -LB Upvote 0 Downvote
Okay, now I see. Group on {table.product} and then change the record selection formula to: {table.date} <= {?effectivedate} Then go to report->edit selection formula->GROUP and enter: {table.date} = maximum({table.date},{table.product}) This will give you the most recent record that is less than or equal to the parm date, and therefore, the current price at that time. -LB
Feb 8, 2005 Thread starter #5 staleb Programmer Feb 7, 2005 45 NO Thanks! I am impressed with the speed on replies on this forum. Wonder why I havent used this before? Upvote 0 Downvote
Thanks! I am impressed with the speed on replies on this forum. Wonder why I havent used this before?