Hi Guys
Not sure if this is possible, I have a simple table as below
Start Date End Date Price
01/01/10 31/12/10 £10
01/01/11 31/12/11 £20
01/01/12 31/12/12 £30
Is there a way to put a flow field (i.e. no coding) on this table to return the Current Price i.e. if the workdate is 20/09/12 the table would show as below
Start Date End Date Price Current Price
01/01/10 31/12/10 £10 £30
01/01/11 31/12/11 £20 £30
01/01/12 31/12/12 £30 £30
Cheers
Steve
Life is for enjoying ... if you find yourself frowning you're doing something wrong
0
Answers
Not really as there can be prices setup in the future as well as the current and past. Wouldn't using MAX would return the latest price and not the current?
Steve
Just a small hint when writing specs, always use a realistic data set for the example. In your case coincidentally the last record is the one you want, but in reality that wont happen. Also are the records ALWAYS 1st Jan to 31 Dec, if not then don't use those as examples either.
Anyway, why do you need a flow field? Just create a function, it will do what you want, it's simple and works just the same. And probably will give you better control.
Could've worded it better but it was getting late in the day. I firstly created a function and then got wrapped in the wrong idea that this may be acheiveable another way. Thought I'd throw it out there in case I missed something.
Regards
Steve
Well what about ppavuk's suggestion:
I have done this before and it works fine, just add code to the OnOpenForm trigger to set a date filter field to '..%1',TODAY
But just using a function as the source expression of a control is very reliable.