Newbies fmfox Posted April 3, 2012 Newbies Posted April 3, 2012 hello, hope somebody could help... i have a db with insurance clients whom i would like to congratulate on their birthdays; my task is to write a script which would give me a list of birthdays in a given period of time, e.g. this week, next month, etc... script which i "wrote": Enter Find Mode Set Field (Clients :: month; Month(Get(CurrentDate))) Perform Find allows me to list persons in a current month only; apart from that, the list shows mixed dates, is not chronological with respect to days any attempts to modify the script with "day" were futile; so obviously i still got to learn a lot... thanks in advance, fmfox
bcooney Posted April 3, 2012 Posted April 3, 2012 You really don't need a script. Just do a Find. 3/*/* finds all dob = March then sort, dob ascending, if you want. Not sure why you need it sorted...for a printout?
comment Posted April 3, 2012 Posted April 3, 2012 Set Field (Clients :: month; Month(Get(CurrentDate))) You have a field for the client's month of birth?? the list shows mixed dates, is not chronological with respect to days If you want to sort them by their order of appearance in the calendar, try defining a calculation field (result is Number) = Month ( DateOfBirth ) + Day ( DateOfBirth ) / 100 and sort by this field. This assumes you are not finding for a period that spans across a year boundary.
Lee Smith Posted April 3, 2012 Posted April 3, 2012 Automatic message This topic has been moved from "FileMaker Product Family → FileMaker Pro 11" to "Database Schema & Business Logic → Calculation Engine (Define Fields)". The General topic areas are intended for the discussion of the functions, features and tools that were new with the particular version mentioned. All how-to question should be posted to a topic area that best matches the sprit of the problem. Many questions can fit into more then one area, but you only need to pick one, and go with it. If you have any questions about this action, please contact me through a private message. Lee
Newbies fmfox Posted April 3, 2012 Author Newbies Posted April 3, 2012 You really don't need a script. Just do a Find. 3/*/* finds all dob = March then sort, dob ascending, if you want. Not sure why you need it sorted...for a printout? yes for printout... thanks for the tip, will give it a try... You have a field for the client's month of birth?? no...a field defined as date in format of dd/mm/yyyy If you want to sort them by their order of appearance in the calendar, try defining a calculation field (result is Number) = Month ( DateOfBirth ) + Day ( DateOfBirth ) / 100 and sort by this field. This assumes you are not finding for a period that spans across a year boundary. that's a precious tip...thanks; will test yours and the one of bcooney...
Newbies fmfox Posted April 4, 2012 Author Newbies Posted April 4, 2012 yes for printout... thanks for the tip, will give it a try... that's a precious tip...thanks; will test yours and the one of bcooney... well, your "find" does find all birthdays of a given month, but ascending sorting sorts by year, but i need by day of the month... any further thoghts? thanks...
bcooney Posted April 4, 2012 Posted April 4, 2012 I'm confused by your setup. Do you have a DateOfBirth field that is a date field?
Newbies fmfox Posted April 13, 2012 Author Newbies Posted April 13, 2012 I'm confused by your setup. Do you have a DateOfBirth field that is a date field? yes i do; and although your Find (3/*/* finds all dob = March) gave me correct result, the Sort was still achronological; so, as comment suggested i solved the problem with an extra calculation field DOB (Month ( DateOfBirth ) + Day ( DateOfBirth ) / 100) and Sort became chronological...thanks...
Recommended Posts
This topic is 4624 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