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?
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