FB-3 CountWorkingDays

35 views
Skip to first unread message

henry...@hotmail.com

unread,
Jul 21, 2025, 4:57:42 AMJul 21
to firebird-support

In FB-3,  Is there any function that calculates working days of given startdate & endDate ?
working days mean EXCEPT Saturdays & Sundays
For example : StartDate = 21/07/2025  EndDate = 29/07/2025 
The Result  = 7
Thank You

Mark Rotteveel

unread,
Jul 21, 2025, 4:58:57 AMJul 21
to firebird...@googlegroups.com
There isn't, not built-in at least. You'll need to write your own PSQL
or UDR function to do that.

Mark
--
Mark Rotteveel

Péter Ádám

unread,
Jul 21, 2025, 7:28:31 AMJul 21
to firebird-support
Maybe you should take care of holidays, too.
In my country there are swapped days, to make a long holiday (together with the weekend).
Only if you are responsible for the business part of the spec, too.

Br,
Peter

Nikolaus Kern

unread,
Jul 21, 2025, 8:13:36 AMJul 21
to firebird-support
Hello Peter,

did you check the function EXTRACT(WEEKDAY FROM <datefield>) ? This should allow you to ignore weekends.

Holidays need to be stored in your own tables.

Niko
Reply all
Reply to author
Forward
0 new messages