Newbies steve weinberg Posted May 17, 2005 Newbies Posted May 17, 2005 I want to create a field that will return a "1" if the date in another field is after 1/1/2005 and return a "0" if the date is prior to 1/1/2005. The argument in the logical functions do not seem to be able to treat a date like a number. If I enter (If "date field">1/1/2005, 1,0) for the calculation for the field I want to create, FileMaker does not seem to under stand the > or the < as greater than or less than in relation to dates. What is the "language" you need to use in a formula that indicates "before or after" a given date? Steve
Lee Smith Posted May 17, 2005 Posted May 17, 2005 Try this Case(date field >Date(1; 1; 2005); 1;0) HTH Lee
LaRetta Posted May 17, 2005 Posted May 17, 2005 In fact, in honor of JT (-Queue-) you can drop the Case() entirely. Make the calculation number: datefield > Date(1;1;2005) This uses Boolean logic and produces a 1 or 0 automatically. On a calculation such as this it doesn't matter (and that's why Lee didn't bother with it) but for more complex calculations the savings can add up and it also is a bit cleaner to write. Sometimes a simpler example shows a principle more clearly. The Boolean logic in more complex formulas then stands out for you and that's my only reason for mentioning it. It's a good understanding to have in your arsenal. JT was the king of Boolean logic and I miss his fine-tuning. LaRetta
Recommended Posts
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