groovybunny
New Member
- Joined
- Apr 23, 2007
- Messages
- 33
Hi Guys, I hope someone can help me with this query!
I have a badly written database to fix, I have invoice generating queries that contain the code
VAT: IIf([VAT Applicable]=True,[Amount]*0.175,0)
If i simply change all of the queries to 15% the historical data will be affected, so I need to add a date parameter and a VAT value table.
The new vat table has 3 columns. Start date, end date and VAT rate
Basically i think i need to say something like...
VAT: iif [VAT applicable]=True, SELECT Vat.Rate
FROM Vat
WHERE GetDate() >= Vat.StartDate AND GetDate < Vat.EndDate;
This isnt working and I think I am missing something really basic! can anyone help me to fix it please
Thank You!
I have a badly written database to fix, I have invoice generating queries that contain the code
VAT: IIf([VAT Applicable]=True,[Amount]*0.175,0)
If i simply change all of the queries to 15% the historical data will be affected, so I need to add a date parameter and a VAT value table.
The new vat table has 3 columns. Start date, end date and VAT rate
Basically i think i need to say something like...
VAT: iif [VAT applicable]=True, SELECT Vat.Rate
FROM Vat
WHERE GetDate() >= Vat.StartDate AND GetDate < Vat.EndDate;
This isnt working and I think I am missing something really basic! can anyone help me to fix it please
Thank You!