Crystal Reports & SQL Reporting Services Training Consultants
Account Log in:
Username:
Password:
Every exit is an entry somewhere else
 
Tom Stoppard
Institute of IT Trainers - Freelance Trainer of the Year 2006 & 2009
Liverpool Business Connect Member
  Maximum Impact Solutions Limited - Reporting Solutions, Creating Answers
Reporting Solutions - Creating Answers, Crystal Reports, Dashboarding (Xcelsius) & SQL Reporting Services

The Maximum Impact Solutions Blog Feed ME!!!!

10
October

How Do I Create a UK VAT Custom Function in Crystal Reports?

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

MAKE A COMMENT

Name *

Email Address *

Comment *