dbTalk Databases Forums  

New Year Calculations stops working

comp.databases.filemaker comp.databases.filemaker


Discuss New Year Calculations stops working in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
vpettes@las-cruces.org
 
Posts: n/a

Default New Year Calculations stops working - 01-09-2006 , 03:17 PM






STARTING DATE:
Mod( WeekofYear(Status( CurrentDate)), 2) * 7 + Status( CurrentDate)-
DayofWeek( Status( CurrentDate) - 1) - 7

ENDING DATE:
Mod( WeekofYear(Status( CurrentDate)), 2) * 7 + Status( CurrentDate)-
DayofWeek( Status( CurrentDate)) + 7

I have been using this calc to insert two dates that represent the
starting date, sunday, and ending date, saturday, of a pay period. As
long as I create these dates before the next new pay period things work
great. Even if I go into the next pay period I can change the
clock/calendar backward to the previous pay period and force it to
create the dates needed. The last pay period ended 1/07/2006,
12/25/2005 to 01/07/2006, so I created a new time sheet today,
01/09/2006, expecting the starting date to be 01/08/2006, sunday, and
the ending date to be 01/21/2006, saturday. Not so. It created
01/01/2006 to 01/14/2006. If I cahnge the calendar to the next pay
period the dates reflect, 01/15/2006 to 01/28/2006. Right two week
span, but wrong dates. How do I revise the calc to reflect the proper
year dates? By the way, the program was transfered from a desktop to a
laptop, if that makes any difference. thanks.


Reply With Quote
  #2  
Old   
FP
 
Posts: n/a

Default Re: New Year Calculations stops working - 01-10-2006 , 11:13 PM






Change your Start / End date formulas to the following:

Start Date =
Status(CurrentDate) - Mod(Status(CurrentDate) - Date(1;8;2006); 14)


End Date =
Status(CurrentDate) + (13 - Mod(Status(CurrentDate) - Date(1;8;2006);
14))


Reply With Quote
  #3  
Old   
vpettes@las-cruces.org
 
Posts: n/a

Default Re: New Year Calculations stops working - 01-11-2006 , 05:34 PM



thanks for your help that works. Now I have another problem. Based on
pay periods, the day fields are filled with the appropriate dates. For
example, pay period 01/08/2006 to 01/21/2006, would fill in, sunday,
01/08/2006, monday, 01/09/2006, tuesday, 01/10/2006, etc. For some
reason, as I go back in the past records the day dates are all the same
dates as though the pay period was 01/08/2006 to 01/21/2006. All the
records in December are the same, all the records in November are all
the same. It gots me confused!


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

Default Re: New Year Calculations stops working - 01-11-2006 , 05:45 PM



I assume the day records that you're refereeing to are displaying
information based on current date, not based on an actual stored dates.
However without seeing your database and just the limited description
that you gave I can't comment on this problem.
If you want an answer you're going to have to explain your table
structure and specifically the date related fields.


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 - 2013, Jelsoft Enterprises Ltd.