Mike G Posted December 15, 2004 Posted December 15, 2004 I'm trying to create a field and have it display ONLY the year on a layout. I created a field ... TEST the type is Date. Clicked on Options and Calculated Value and in the calculation window entered Year(Get(Current Date)). I thought this would return only 2004 in the field test. What I get is 6/27/0006. I even tried changing the Get(Current Date) to a known date field and still get 6/27/0006. Has me baffled! Can someone tell me how I can get a field to display only 2004 when the record is created in 2004 and also.... what the heck is the 6/27/0006? I've already double checked that the date on my machine is correct.
Lee Smith Posted December 15, 2004 Posted December 15, 2004 What do you get if you have the result of Text? The field result has to be text. When you select date, FileMaker is trying to make 2004 into XX/XX/XXXX. HTH Lee
Mike G Posted December 15, 2004 Author Posted December 15, 2004 Well, that does work... imagine that huh? Thank You! Didn't seem logical to me to make it a text field when I was dealing with a date. I'll learn this eventually I hope... keep plugging away at least. I do appreciate your direction!!!
-Queue- Posted December 15, 2004 Posted December 15, 2004 A date field will only return a result in a date format. Dates are merely numbers, the number of days since 1/1/0001. Year(Get(CurrentDate)) is not a date; it is a year. As a date it translates to 2004 days (currently) since 1/1/0001, which would be 6/27/0006. So it must either be text or a number, not a date. A simpler solution would be to use Get(CurrentDate) and then format the field on the layout to display only the year. If it's only for visual purposes, I would go with this route.
Recommended Posts
This topic is 7546 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