IF {VENDOR.CURRENCY_ID} = "US ($)" THEN
DIM DATE_DIF
DATE_DIF = DateDiff ("d", {VENDOR_QUOTE.QUOTE_DATE}, {CURRENCY_EXCHANGE.EFFECTIVE_DATE})
if DATE_DIF < 0 then
formula = {VENDOR_QUOTE.DEFAULT_UNIT_PRICE}/{CURRENCY_EXCHANGE.SELL_RATE}
end if
there 10 firerent date on te table currency date i need de closer one to the quote date ????
while wil be perfect to do this bat i dont this is what i dont know (basic syntax)...
well may be if onyone know who to select the first smoll date
Rem Basic syntax
Dim d1, d2, total,x
d1 = {VENDOR_QUOTE.QUOTE_DATE}
d2 = {CURRENCY_EXCHANGE.EFFECTIVE_DATE}
total = DateDiff ("d", d1, d2)
formula = total <= 1 'Here i need the first < only
Did you try my solution? I'm assuming that if the dates look like this:
Effective Date Quote Date
1-Mar-05 2-Jun-05
3-Apr-05 2-Jun-05
8-May-05-you want this one 2-Jun-05
15-Jun-05 2-Jun-05
...that you want the first effective date right before the quote date. Therefore, you don't want any effective dates that are greater than the quote date, and so you should use a record selection formula like:
Rem Basic syntax
Dim d1, d2, total,x
d1 = {VENDOR_QUOTE.QUOTE_DATE}
d2 = {CURRENCY_EXCHANGE.EFFECTIVE_DATE}
formula = DateDiff ("d", d1, d2)
...the result will always be negative. For the example, above, after using the record selection formula, the results would look like:
Effective Date Quote Date Datediff
1-Mar-05 2-Jun-05 -96
3-Apr-05 2-Jun-05 -63
8-May-05 2-Jun-05 -28
You need to insert a group on {VENDOR_QUOTE.QUOTE_DATE}. Then, to get the closest Effective Date, you would then need to right click on the Effective Date and insert a maximum to get 8-May-05.
If you only want to show that row in your report, then go to report->selection formula->GROUP and enter:
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.