During a recent training session, I was asked by one of the delegates, "How do I create a custom function, that calculates the VAT rates for the UK, in crystal Reports 2008?"
The UK VAT Rates, have been up and down like a yo-yo, over the last few years, and the delegate, wanted a quick and easy way to calculate the correct VAT rate, based on the database invoice date field.
Solution:
One can create a custom function from the Report Menu - Formula Workshop
Press the New button and name the custom function
Enter the following formula syntax:
Function (DateTimeVar DateField)
NumberVar VAT_Rate;
Select DateField Case upfrom #Jan 4, 2011# : VAT_Rate := .20 Case #Dec 1, 2008# To #Dec 31, 2009#: VAT_Rate := .15 Default : VAT_Rate := .175;
VAT_Rate
If you have any questions, leave us a comment below, or need any assistance, please do not hesitate to Contact Us
|