kshelton Posted September 20, 2010 Posted September 20, 2010 Fields: Date, Tax Year Please note dates are d/m/y as I am in UK. I want Tax Year entry to be automatic depending on Date, e.g. Tax Year '2009-2010' would apply to all records dated 6-4-2009 to 5-4-2010. When I tried a Calc it did not work. I then experimented with a script using single dates instead of a range and found that my Calc (Date < "5/4/2009") is merely operating on the first digit and therefore triggers dates starting with a digit below 5 and ignores month and year, e.g. ignores 6/4/2008, 7/6/2010 but triggers 13/4/2008 and 3/5/2010. I tried a simple find for the range of dates and this worked. I have searched but cannot see what I need to do to make my Calc respect the date. Help! Thanks Keith
TheTominator Posted September 20, 2010 Posted September 20, 2010 (edited) If your field is named TheDate and your date is in d/m/y, then theDate < Date(4; 5; 2009) is what you need when making a simple comparison. Put together multiple comparisons with parentheses and "and", e.g. ( a < and ( a > c) The Date() function takes month, day, year values and converts them into an internal FileMaker date. See also Day(), Month(), Year() functions for extracting those pieces as numbers from a date. Edited September 20, 2010 by Guest
comment Posted September 20, 2010 Posted September 20, 2010 (edited) Try = Let ( [ y = Year ( Date ) ; t = y - ( Date < Date ( 4 ; 6 ; y ) ) ] ; t & "-" & t + 1 ) Result type should be Text. This should work foe ANY year - assuming your tax year always starts on April 6th. Edited September 20, 2010 by Guest
kshelton Posted September 21, 2010 Author Posted September 21, 2010 Thanks very much to both. I have managed to set it up so that it applies automatically to any year. Just what I wanted. Thanks again. Keith
Recommended Posts
This topic is 5235 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now