dbTalk Databases Forums  

Monthly Report

comp.databases.filemaker comp.databases.filemaker


Discuss Monthly Report in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Barry
 
Posts: n/a

Default Monthly Report - 07-31-2003 , 11:21 PM






Having troubles defining a script for finding and printing sales for the
month.
Thanks
Barry



Reply With Quote
  #2  
Old   
Bridget Eley
 
Posts: n/a

Default Re: Monthly Report (Correction) - 08-01-2003 , 02:31 AM






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)


Reply With Quote
  #3  
Old   
Glenn Schwandt
 
Posts: n/a

Default Re: Monthly Report (Correction) - 08-01-2003 , 08:44 AM



Last day of previous month is day 0 of this month (not -1).

"Bridget Eley" <bridgeteley (AT) ihug (DOT) com.au> wrote

Quote:
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)




Reply With Quote
  #4  
Old   
Glenn Schwandt
 
Posts: n/a

Default Re: Monthly Report (Correction) - 08-01-2003 , 08:45 AM



Sorry, didn't notice the "1-1" (which is the same as 0).

"Glenn Schwandt" <schwandtgat (AT) aoldot (DOT) com> wrote

Quote:
Last day of previous month is day 0 of this month (not -1).


<SNIP>




Reply With Quote
  #5  
Old   
Barry
 
Posts: n/a

Default Re: Monthly Report (Correction) - 08-01-2003 , 09:39 AM



This is great.....I can't thank you enough for all the help given
Have a wonderful day
Barry


"Glenn Schwandt" <schwandtgat (AT) aoldot (DOT) com> wrote

Quote:
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





Reply With Quote
  #6  
Old   
Bridget Eley
 
Posts: n/a

Default Re: Monthly Report (Correction) - 08-01-2003 , 04:05 PM



From a performance point of view, I guess using 0 would be better (one less
thing to calculate) although in a script like this, I doubt it would make a
perceptible difference. Using 1-1 has one advantage though: it seems to say
what it means, "one day less than the first day", which is obviously the
last day of the previous month, which does makes the calc easier to
understand when you come back to it after a spell (whereas 0 is a little
more ambiguous).

The main point as far as Barry is concerned is that the calc works whether
you use 0 or 1-1 because Filemaker knows how to roll back the dates to the
previous month and/or year if the day and/or month are zero or even negative
values. So there is absolutely no need to wrestle with humungous calcs that
attempt to manually calculate the last day of a given month and where
necessary adjust the year, covering such variations as 31, 30, 29 and 28 day
months as well as months that fall in the previous year. Just wish someone
had told me that when I was starting out...

;-)

Bridget

in article vikrn9krslstc5 (AT) corp (DOT) supernews.com, Glenn Schwandt at
schwandtgat (AT) aoldot (DOT) com wrote on 1/8/03 11:45 PM:

Quote:
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




Reply With Quote
  #7  
Old   
TKnDallas
 
Posts: n/a

Default Re: Monthly Report - 08-05-2003 , 12:40 AM



When I know I have data that will need to be reported by Weekly or
Monthly I create the appropriate Calc-Field. I use SDATE as my
standard field name for Sales_Date. The Month field is
Year(SDATE)&right("0"&month(SDATE),2). This makes selecting records
for a particular month much easier. I do a similar calc for Week
numbers where I have a result of YearWk such as 200352.

Thomas Hill, CHAE, CHTP
Controller
Balcones Country Club


Bridget Eley <bridgeteley (AT) ihug (DOT) com.au> wrote

Quote:
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



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.