John Chamberlain Posted March 18, 2013 Posted March 18, 2013 I am trying to build a data base for a local non-prof. They rescue cats and kittens, and try to place them in good homes. The application will track the intake and discharge of each animal. As part of this they want a quarterly report of how many animals came in, went out, were spayed or neutered, etc. I have figured how to gather the data and display it, but have run into a roadblock on the report. I cannot see what to do when the end of a year occurs. I have scritpted the 1st, 2nd and 3rd quarterly reports, but not the year end. Obviously the final data for a year cannot be entered until the last entries are known, in January of the following year. I can generate the report if I force the user to enter the search dates (1/1/YY...12/31/YY) but that is not what I would like to do. At the most, I would like them to enter the year, and then run a script to generate the report. What I need is a find script step that will cover the period 1/1/previous year...12/31/previous year. Can anyone tell me how to do this?
doughemi Posted March 19, 2013 Posted March 19, 2013 Enter Find Mode Set Field[ <yourDateField>; Date(1; 1; Year(Get(CurrentDate)) - 1) & "..." & Date(12; 31; Year(Get(CurrentDate)) - 1)] Perform Find If you want the user to be able to report any year, add a global field g.YearToReport, and change Year(Get(CurrentDate)) - 1 to g.YearToReport in the script step above.
LaRetta Posted March 19, 2013 Posted March 19, 2013 Or even find on just Year ( Get ( Current Date ) ) - 1 Entering just four digits into a date field is interpreted as requesting calendar year. So user could enter year into custom dialog even
John Chamberlain Posted March 21, 2013 Author Posted March 21, 2013 That was the right answer - thanks LaRetta (and Dougheml)!
Recommended Posts
This topic is 4322 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