![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
|
Paragraph beginning "Re calculation" should read: you get the first day of the last month by taking 1 from the current month, setting the day to 1 and setting the year to the current year (this will still work even if the current date is 1st Jan 2003 because the date will look like 0/1/2003 which filemaker knows how to convert to 12/1/2002); you get the last day of the last month by setting the month to the current month, setting the day to 1-1 and the year to the current year (if the current date is 1st Aug 2003 that will produce 8/0/2003 which filemaker converts to 7/31/2003, and again, this will also work if the date is 1st Jan 2003 which will produce 1/0/2003 which filemaker converts to 12/31/2002) |
#4
| |||
| |||
|
|
Last day of previous month is day 0 of this month (not -1). |
#5
| |||
| |||
|
|
Sorry, didn't notice the "1-1" (which is the same as 0). "Glenn Schwandt" <schwandtgat (AT) aoldot (DOT) com> wrote in message news:vikrl79s9pkea0 (AT) corp (DOT) supernews.com... Last day of previous month is day 0 of this month (not -1). SNIP |
#6
| |||
| |||
|
|
Sorry, didn't notice the "1-1" (which is the same as 0). "Glenn Schwandt" <schwandtgat (AT) aoldot (DOT) com> wrote in message news:vikrl79s9pkea0 (AT) corp (DOT) supernews.com... Last day of previous month is day 0 of this month (not -1). SNIP |
#7
| |||
| |||
|
|
Hi Barry A little more information would be helpful... This script requires no input from user, and will always find all records from the first to the last day of the previous month, regardless of the number of days in the month, and regardless of the proximity of the current date to the change of year. However, it does assume that the monthly report is always for the previous month (which gives you roughly 30 days to remember to do it...): Go to Layout [Layout#?] Enter Find Mode[] Insert Calculated Result [Date, DateToText(Date(Month(Status(CurrentDate)) - 1, 1, Year(Status(CurrentDate)))) & "..." & DateToText(Date(Month(Status(CurrentDate)), 1 - 1, Year(Status(CurrentDate))))] Perform Find [] The rest of the script would go to the report layout, page setup, enter preview mode (with pause), print, etc. Don't forget error checking for no records found, cancelled printing and so on. You must use Insert Calculated Result rather than Set Field, you must convert dates to text and you must be on a layout that contains the Date field. Re calculation: you get the first day of the last month by taking 1 from the current month, setting the day to 1 and setting the year to the current year (this will still work even if the current date is 1st Jan 2003 because the date will look like -1/1/2003 which filemaker knows how to convert to 12/1/2002); you get the last day of the last month by setting the month to the current month, setting the day to 1-1 and the year to the current year (if the current date is 1st Aug 2003 that will produce 8/-1/2003 which filemaker converts to 7/31/2003, and again, this will also work if the date is 1st Jan 2003 which will produce 1/-1/2003 which filemaker converts to 12/31/2002) Bridget Eley in article FVlWa.25015$It4.17746 (AT) rwcrnsc51 (DOT) ops.asp.att.net, Barry at barryge (AT) comcast (DOT) net wrote on 1/8/03 2:21 PM: Having troubles defining a script for finding and printing sales for the month. Thanks Barry |
![]() |
| Thread Tools | |
| Display Modes | |
| |