Focal Point
[SOLVED] Getting previous VAT rate

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/7077088795

January 31, 2011, 06:16 AM
Jinx
[SOLVED] Getting previous VAT rate
Hi,

I have a situation where I need to calculate the VAT rate for a particular account, when the account was first set to live, not at the current VA rate. So I have the start and end dates for VAT rates and I have the date the account went into action. I basically need to return the vatrate for when ACCSDAT between VATSTARTDATE AND VATENDDATE. I'm really not sure how to go about doing this. Decode was something I tried, but from what I know of DECODE (and how to use it) it will only return a matching value not a BETWEEN, same with something like DB_LOOKUP. Are there any super-duper-clever ways of doing something like this?

FILENAME=  VAT
 VSDATE      START_DATE    DMYY
 VEDATE      END_DATE      DMYY
 VATRATE     RATE          P6.3B
  


FILENAME=  ACCOUNT
 ACCID      ID    I9
 ACCSDATE   START_DATE    DMYY
 ACCMOUNT   AMOUNT        P6.3B


Thanks!

Jinx.

This message has been edited. Last edited by: Jinx,


7.6.11
Windows
HTML, PDF, Excel etc
DevStudio/Webfocus/Focus IBM
SQL Server 2000 / 2008
DB2
January 31, 2011, 08:03 AM
Tony A
Do you have VAT_Amount in your Account table?

If so then reverse engineer the VAT, if not then perhaps McGyver technique (loose join) and then use DEFINE?

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
January 31, 2011, 08:12 AM
Jinx
No unfortunately no VAT RATE in the account table. I've tried for 3 years to avoid the McGyver...seems like it's time to try and figure it out.
Thanks.

Jinx.


7.6.11
Windows
HTML, PDF, Excel etc
DevStudio/Webfocus/Focus IBM
SQL Server 2000 / 2008
DB2
January 31, 2011, 09:07 AM
j.gross
Use a condition-based join.
January 31, 2011, 09:14 AM
Jinx
Yep that's exactly what I've done.


7.6.11
Windows
HTML, PDF, Excel etc
DevStudio/Webfocus/Focus IBM
SQL Server 2000 / 2008
DB2