dbTalk Databases Forums  

Help with date calcuation

comp.databases.filemaker comp.databases.filemaker


Discuss Help with date calcuation in the comp.databases.filemaker forum.



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

Default Help with date calcuation - 06-01-2007 , 05:18 PM






Would someone help me come up with a formula to subtact ten weekdays
(not counting Saturdays and Sundays) from the date I enter in an
existing date field? Thanks.

Reply With Quote
  #2  
Old   
Howard Schlossberg
 
Posts: n/a

Default Re: Help with date calcuation - 06-01-2007 , 05:31 PM






I'm sure someone will post the more complex calculation, but perhaps the
easiest way to think about this is that it is always 14 days total
(unless the base date is itself on a weekend).

JoelL wrote:
Quote:
Would someone help me come up with a formula to subtact ten weekdays
(not counting Saturdays and Sundays) from the date I enter in an
existing date field? Thanks.
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Howard Schlossberg (818) 883-2846
FM Professional Solutions, Inc. Los Angeles

FileMaker 8 Certified Developer
Associate Member, FileMaker Solutions Alliance


Reply With Quote
  #3  
Old   
Helpful Harry
 
Posts: n/a

Default Re: Help with date calcuation - 06-01-2007 , 06:03 PM



In article <13617ho1fiaq74f (AT) corp (DOT) supernews.com>, Howard Schlossberg
<howard (AT) antispahm (DOT) fmprosolutions.com> wrote:
Quote:
JoelL wrote:
Would someone help me come up with a formula to subtact ten weekdays
(not counting Saturdays and Sundays) from the date I enter in an
existing date field? Thanks.

I'm sure someone will post the more complex calculation, but perhaps the
easiest way to think about this is that it is always 14 days total
(unless the base date is itself on a weekend).
Yep, that's a very nice simple solution so there's no point in making
it more complicated than that.

TenWeekDayAgo = Date - 14

As well as the problem when Date is a weekend, there is one other
hiccup if you're counting the Date itself as one of those 10 days, but
you're probably not.

Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)


Reply With Quote
  #4  
Old   
d-42
 
Posts: n/a

Default Re: Help with date calcuation - 06-04-2007 , 01:58 AM



On Jun 1, 4:03 pm, Helpful Harry <helpful_ha... (AT) nom (DOT) de.plume.com>
wrote:
Quote:
In article <13617ho1fiaq... (AT) corp (DOT) supernews.com>, Howard Schlossberg

how... (AT) antispahm (DOT) fmprosolutions.com> wrote:
JoelL wrote:
Would someone help me come up with a formula to subtact ten weekdays
(not counting Saturdays and Sundays) from the date I enter in an
existing date field? Thanks.

I'm sure someone will post the more complex calculation, but perhaps the
easiest way to think about this is that it is always 14 days total
(unless the base date is itself on a weekend).

Yep, that's a very nice simple solution so there's no point in making
it more complicated than that.

TenWeekDayAgo = Date - 14

As well as the problem when Date is a weekend, there is one other
hiccup if you're counting the Date itself as one of those 10 days, but
you're probably not.

Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)
Not that that its that much more complicated if the date is on a
weekend:

case(
DayOfWeek(date)=1, date-13,
DayOfWeek(date)=7, date-12,
date-14
)

-cheers,
Dave



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.