DocD Posted July 27, 2006 Share Posted July 27, 2006 Hi All, OK, I have a field called 'User_DateOfBirth'. Obviously it is simply a date field with month/day/year. What I want to do is simply sort the field without using the year so I might be able to judge whose birthday is approaching...so, I need to have the year extracted in a script... Thanks! DocD Link to comment Share on other sites More sharing options...
comment Posted July 27, 2006 Share Posted July 27, 2006 You need a calculation field, not a script. The actual calculation can be done in several ways, for example: Date ( Month ( User_DateOfBirth ) ; Day ( User_DateOfBirth ) ; 4 ) result is Date or: Month ( User_DateOfBirth ) + Day ( User_DateOfBirth ) / 100 result is Number or even: DayOfYear ( User_DateOfBirth ) result is Number Then sort by the calculation field instead of User_DateOfBirth. Note: - Using the first option, you can format the result to show just the month and day, so it displays like "Birthday: July 28" on the layout; - Using the last option, people born in a leap year on March 1 or later, will be placed after people born on the same date in a non-leap year. Link to comment Share on other sites More sharing options...
Ender Posted July 27, 2006 Share Posted July 27, 2006 Try sorting by a calc that has the month and day only, like this: right("00" & Month(User_DateOfBirth);2) & right("00" & day(User_DateOfBirth);2) Link to comment Share on other sites More sharing options...
DocD Posted July 27, 2006 Author Share Posted July 27, 2006 ...thanks! That was quick, that was easy...and it worked! Simple, I've got the idea now... DocD Link to comment Share on other sites More sharing options...
Recommended Posts