dbTalk Databases Forums  

Date and Academic Season Calc?

comp.databases.filemaker comp.databases.filemaker


Discuss Date and Academic Season Calc? in the comp.databases.filemaker forum.



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

Default Date and Academic Season Calc? - 07-30-2005 , 06:29 PM






I'm trying to get FM to calculate the Academic Season based on a date
and to sort based on season with summary headers like Summer2004, Fall
2004, in order of season and year or is it year and season?, etc;

example

7/1/2004 = Summer 2004
8/1/2004 = Fall 2004
11/1/2004 = Winter 2004
1/1/2005 = Winter 2004 <--- part of 2004
3/1/2005 = Spring 2005
6/1/2005 = Summer 2005


7/1/2005 = Summer 2005
8/1/2005 = Fall 2005
11/1/2005 = Winter 2005
1/1/2006 = Winter 2005 <--- part of 2005
3/1/2006 = Spring 2006
6/1/2006 = Summer 2006

can filemaker go back 13 years and calculated the sesons? and what
calcs do I need?

Thanks a million.

Reply With Quote
  #2  
Old   
Matt Wills
 
Posts: n/a

Default Re: Date and Academic Season Calc? - 07-30-2005 , 07:00 PM






Test wrote:

Quote:
I'm trying to get FM to calculate the Academic Season based on a date
and to sort based on season with summary headers like Summer2004, Fall
2004, in order of season and year or is it year and season?, etc;

example

7/1/2004 = Summer 2004
8/1/2004 = Fall 2004
11/1/2004 = Winter 2004
1/1/2005 = Winter 2004 <--- part of 2004
3/1/2005 = Spring 2005
6/1/2005 = Summer 2005


7/1/2005 = Summer 2005
8/1/2005 = Fall 2005
11/1/2005 = Winter 2005
1/1/2006 = Winter 2005 <--- part of 2005
3/1/2006 = Spring 2006
6/1/2006 = Summer 2006

can filemaker go back 13 years and calculated the sesons? and what
calcs do I need?

Thanks a million.
Assuming you have a date field named, for instance, TheDate, your calc
field might be

Season =

Case (

Month ( TheDate ) = 6 or Month ( TheDate ) = 7 ; "Summer " & Year (
TheDate );

Month ( TheDate ) = 8 or Month ( TheDate ) = 9 or Month ( TheDate ) = 10
; "Fall " & Year ( TheDate ) ;

Month ( TheDate ) = 11 or Month ( TheDate ) = 12 ; "Winter " & Year (
TheDate );

Month ( TheDate ) = 1 or Month ( TheDate ) = 2; "Winter " & Year (
TheDate ) - 1;

Month ( TheDate ) = 3 or Month ( TheDate ) = 4 or Month ( TheDate ) = 5
; "Spring " & Year ( TheDate )

)

It will return the specified season for the month regardless what the year
is.

Matt


Reply With Quote
  #3  
Old   
Matt Wills
 
Posts: n/a

Default Re: Date and Academic Season Calc? - 07-30-2005 , 07:08 PM



For some reason, I keep forgetting how much cleaner it can look until later:

Season =

Let ( [ Mo = Month ( TheDate ); Yr = Year ( TheDate ) ] ;

Case (

Mo = 6 or Mo = 7 ; "Summer " & Yr;

Mo = 8 or Mo = 9 or Mo = 10 ; "Fall " & Yr ;

Mo = 11 or Mo = 12 ; "Winter " & Yr;

Mo = 1 or Mo = 2; "Winter " & Yr - 1;

Mo = 3 or Mo = 4 or Mo = 5 ; "Spring " & Yr

))

Reply With Quote
  #4  
Old   
Test
 
Posts: n/a

Default Re: Date and Academic Season Calc? - 07-31-2005 , 01:54 PM



In article <BDUGe.4472$GN5.3542@trndny08>, Matt Wills <I'm (AT) Witz (DOT) end>
wrote:

Quote:
For some reason, I keep forgetting how much cleaner it can look until later:

Season =

Let ( [ Mo = Month ( TheDate ); Yr = Year ( TheDate ) ] ;

Case (

Mo = 6 or Mo = 7 ; "Summer " & Yr;

Mo = 8 or Mo = 9 or Mo = 10 ; "Fall " & Yr ;

Mo = 11 or Mo = 12 ; "Winter " & Yr;

Mo = 1 or Mo = 2; "Winter " & (Yr - 1);

Mo = 3 or Mo = 4 or Mo = 5 ; "Spring " & Yr

))
So far so good. Now how do I get FM to group and sort by the result of
the calc, ie. for the purpose of a student transcript summary by qtr.

Summer 2005
1 class
2 class
3 class...
Fall 2005
1 class
2 class...
12 classes
Winter 2005
10 classes
Spring 2006
7 classes

Summer 2006
2 classes
Fall 2006
9 classes
Winter 2006
10 classes
Spring 2007
11 classes

Thank you for your help.

Martin


Reply With Quote
  #5  
Old   
Matt Wills
 
Posts: n/a

Default Re: Date and Academic Season Calc? - 07-31-2005 , 06:30 PM



Test wrote:

Quote:
In article <BDUGe.4472$GN5.3542@trndny08>, Matt Wills <I'm (AT) Witz (DOT) end
wrote:

For some reason, I keep forgetting how much cleaner it can look until
later:

Season =

Let ( [ Mo = Month ( TheDate ); Yr = Year ( TheDate ) ] ;

Case (

Mo = 6 or Mo = 7 ; "Summer " & Yr;

Mo = 8 or Mo = 9 or Mo = 10 ; "Fall " & Yr ;

Mo = 11 or Mo = 12 ; "Winter " & Yr;

Mo = 1 or Mo = 2; "Winter " & (Yr - 1);

Mo = 3 or Mo = 4 or Mo = 5 ; "Spring " & Yr

))

So far so good. Now how do I get FM to group and sort by the result of
the calc, ie. for the purpose of a student transcript summary by qtr.

Summer 2005
1 class
2 class
3 class...
Fall 2005
1 class
2 class...
12 classes
Winter 2005
10 classes
Spring 2006
7 classes

Summer 2006
2 classes
Fall 2006
9 classes
Winter 2006
10 classes
Spring 2007
11 classes

Thank you for your help.

Martin
Sort on the date by which the academic season is calculated. Sorting on
the season calc would put it out of calendar order.

Matt



Reply With Quote
  #6  
Old   
Test
 
Posts: n/a

Default Re: Date and Academic Season Calc? - 07-31-2005 , 08:03 PM



In article <3adHe.6045$r12.5801@trndny04>, Matt Wills <I'm (AT) Witz (DOT) end>
wrote:

Quote:
Test wrote:

In article <BDUGe.4472$GN5.3542@trndny08>, Matt Wills <I'm (AT) Witz (DOT) end
wrote:

For some reason, I keep forgetting how much cleaner it can look until
later:

Season =

Let ( [ Mo = Month ( TheDate ); Yr = Year ( TheDate ) ] ;

Case (

Mo = 6 or Mo = 7 ; "Summer " & Yr;

Mo = 8 or Mo = 9 or Mo = 10 ; "Fall " & Yr ;

Mo = 11 or Mo = 12 ; "Winter " & Yr;

Mo = 1 or Mo = 2; "Winter " & (Yr - 1);

Mo = 3 or Mo = 4 or Mo = 5 ; "Spring " & Yr

))

So far so good. Now how do I get FM to group and sort by the result of
the calc, ie. for the purpose of a student transcript summary by qtr.

Summer 2005
1 class
2 class
3 class...
Fall 2005
1 class
2 class...
12 classes
Winter 2005
10 classes
Spring 2006
7 classes

Summer 2006
2 classes
Fall 2006
9 classes
Winter 2006
10 classes
Spring 2007
11 classes

Thank you for your help.

Martin

Sort on the date by which the academic season is calculated. Sorting on
the season calc would put it out of calendar order.

Matt
If i sort by the date, I get sub-summaries for every class, I'm looking
for sub-summaries by qtr.

Thanks

Martin


Reply With Quote
  #7  
Old   
Matt Wills
 
Posts: n/a

Default Re: Date and Academic Season Calc? - 07-31-2005 , 08:11 PM



Test wrote:

Quote:
In article <3adHe.6045$r12.5801@trndny04>, Matt Wills <I'm (AT) Witz (DOT) end
wrote:

Test wrote:

In article <BDUGe.4472$GN5.3542@trndny08>, Matt Wills <I'm (AT) Witz (DOT) end
wrote:

For some reason, I keep forgetting how much cleaner it can look until
later:

Season =

Let ( [ Mo = Month ( TheDate ); Yr = Year ( TheDate ) ] ;

Case (

Mo = 6 or Mo = 7 ; "Summer " & Yr;

Mo = 8 or Mo = 9 or Mo = 10 ; "Fall " & Yr ;

Mo = 11 or Mo = 12 ; "Winter " & Yr;

Mo = 1 or Mo = 2; "Winter " & (Yr - 1);

Mo = 3 or Mo = 4 or Mo = 5 ; "Spring " & Yr

))

So far so good. Now how do I get FM to group and sort by the result of
the calc, ie. for the purpose of a student transcript summary by qtr.

Summer 2005
1 class
2 class
3 class...
Fall 2005
1 class
2 class...
12 classes
Winter 2005
10 classes
Spring 2006
7 classes

Summer 2006
2 classes
Fall 2006
9 classes
Winter 2006
10 classes
Spring 2007
11 classes

Thank you for your help.

Martin

Sort on the date by which the academic season is calculated. Sorting on
the season calc would put it out of calendar order.

Matt

If i sort by the date, I get sub-summaries for every class, I'm looking
for sub-summaries by qtr.

Thanks

Martin
OK, lets do another calc field that assigns a numeric value to the quarter.

Use the same calculation as before, except return a numeric value instead
of the season , then sort on that. Try the year and the value, like maybe
2004.1, 2004.2, etc. That would be Field = Yr ( TheDate ) &".1"

Matt


Reply With Quote
  #8  
Old   
Test
 
Posts: n/a

Default Re: Date and Academic Season Calc? - 07-31-2005 , 11:26 PM



In article <iFeHe.1977$va1.1883@trndny09>, Matt Wills <I'm (AT) Witz (DOT) end>
wrote:

Quote:
Test wrote:

In article <3adHe.6045$r12.5801@trndny04>, Matt Wills <I'm (AT) Witz (DOT) end
wrote:

Test wrote:

In article <BDUGe.4472$GN5.3542@trndny08>, Matt Wills <I'm (AT) Witz (DOT) end
wrote:

For some reason, I keep forgetting how much cleaner it can look until
later:

Season =

Let ( [ Mo = Month ( TheDate ); Yr = Year ( TheDate ) ] ;

Case (

Mo = 6 or Mo = 7 ; "Summer " & Yr;

Mo = 8 or Mo = 9 or Mo = 10 ; "Fall " & Yr ;

Mo = 11 or Mo = 12 ; "Winter " & Yr;

Mo = 1 or Mo = 2; "Winter " & (Yr - 1);

Mo = 3 or Mo = 4 or Mo = 5 ; "Spring " & Yr

))

So far so good. Now how do I get FM to group and sort by the result of
the calc, ie. for the purpose of a student transcript summary by qtr.

Summer 2005
1 class
2 class
3 class...
Fall 2005
1 class
2 class...
12 classes
Winter 2005
10 classes
Spring 2006
7 classes

Summer 2006
2 classes
Fall 2006
9 classes
Winter 2006
10 classes
Spring 2007
11 classes

Thank you for your help.

Martin

Sort on the date by which the academic season is calculated. Sorting on
the season calc would put it out of calendar order.

Matt

If i sort by the date, I get sub-summaries for every class, I'm looking
for sub-summaries by qtr.

Thanks

Martin

OK, lets do another calc field that assigns a numeric value to the quarter.

Use the same calculation as before, except return a numeric value instead
of the season , then sort on that. Try the year and the value, like maybe
2004.1, 2004.2, etc. That would be Field = Yr ( TheDate ) &".1"

I ended up assigning a numeric value to the season as in

Spring = 1
Summer =2
Fall = 3
Winter =4

and creating a merge field for year and numeric value of season as you
suggested.

works beautifully!

Thanks a million! This has been on the back burner for months and to
think that it could be solved in a day!

Martin


Reply With Quote
  #9  
Old   
Matt Wills
 
Posts: n/a

Default Re: Date and Academic Season Calc? - 08-01-2005 , 04:33 AM



Test wrote:

Quote:
In article <iFeHe.1977$va1.1883@trndny09>, Matt Wills <I'm (AT) Witz (DOT) end
wrote:

Test wrote:

In article <3adHe.6045$r12.5801@trndny04>, Matt Wills <I'm (AT) Witz (DOT) end
wrote:

Test wrote:

In article <BDUGe.4472$GN5.3542@trndny08>, Matt Wills <I'm (AT) Witz (DOT) end
wrote:

For some reason, I keep forgetting how much cleaner it can look until
later:

Season =

Let ( [ Mo = Month ( TheDate ); Yr = Year ( TheDate ) ] ;

Case (

Mo = 6 or Mo = 7 ; "Summer " & Yr;

Mo = 8 or Mo = 9 or Mo = 10 ; "Fall " & Yr ;

Mo = 11 or Mo = 12 ; "Winter " & Yr;

Mo = 1 or Mo = 2; "Winter " & (Yr - 1);

Mo = 3 or Mo = 4 or Mo = 5 ; "Spring " & Yr

))

So far so good. Now how do I get FM to group and sort by the result of
the calc, ie. for the purpose of a student transcript summary by qtr.

Summer 2005
1 class
2 class
3 class...
Fall 2005
1 class
2 class...
12 classes
Winter 2005
10 classes
Spring 2006
7 classes

Summer 2006
2 classes
Fall 2006
9 classes
Winter 2006
10 classes
Spring 2007
11 classes

Thank you for your help.

Martin

Sort on the date by which the academic season is calculated. Sorting on
the season calc would put it out of calendar order.

Matt

If i sort by the date, I get sub-summaries for every class, I'm looking
for sub-summaries by qtr.

Thanks

Martin

OK, lets do another calc field that assigns a numeric value to the
quarter.

Use the same calculation as before, except return a numeric value instead
of the season , then sort on that. Try the year and the value, like maybe
2004.1, 2004.2, etc. That would be Field = Yr ( TheDate ) &".1"

I ended up assigning a numeric value to the season as in

Spring = 1
Summer =2
Fall = 3
Winter =4
That was my original thought, but dismissed it because it would keep the
seasons together, but not the years. A multi-key sort would have taken
care of that, but I figured we might as well put all of it together, and
have only one sort key.

I later realized that a calc based on the calendar year would not have
worked properly either, remembering that we had subracted 1 from the year
for January and February to place them in the previous year's Academic
Winter. It would have to be something based on the academic season, like

Right ( Season ; 4 ) & ".1"

Regardless, glad to be of help.

MAtt


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.