Subject Re: date to date weekdays
From Ken Mayer <dbase@nospam.goldenstag.net>
Date Sat, 19 Apr 2025 05:06:43 -0700
Newsgroups dbase.getting-started

On 4/15/2025 7:08 AM, Samuel Partida wrote:
> how to remove weekend days from date to date to subtract (formula)
> I need to remove subtract all Saturday's and Sundays from any given date to date.

Take a look at several ways to determine this kind of thing.

Dates have their own internal format, and can be done either as a date
object (new date()) or as the older date() type.

When using a date object:
    d = new date()
    ? d.day
    // understand that the day property is zero based:
    // Sunday = 0, Saturday = 6

When using the date() type (a field, for example):
    d = date()
    ? dow( d )
    // this is 1 based, so:
    // Sunday = 1, Saturday = 7

Also look in the dUFLP, there is a method in the holiday class
(holiday.cc) called WorkDays() ... this may be useful for what you're
looking for.

Ken

--
*Ken Mayer*
Ken's dBASE Page: http://www.goldenstag.net/dbase
The dUFLP: http://www.goldenstag.net/dbase/index.htm#duflp
dBASE Books: http://www.goldenstag.net/dbase/Books/dBASEBooks.htm
dBASE Tutorial: http://www.goldenstag.net/dbase/Tutorial/00_Preface.htm
dBASE Web Tutorial: http://www.goldenstag.net/dbase/WebTutorial/00_Menu.htm
dBASE DOS to Windows Tutorial:
http://www.goldenstag.net/dbase/DtoWTutorial/00_Menu.htm