FreeAdhocUDF for InterBase and FireBird in deutschin englishen français
homeprevious pageÜbersicht • overview • aperçunext pagelast page mailing-listwas ich vermisse • what I missed •eMail Kommentar • eMail commentprint
 

Functions enclosed in FreeAdhocUDF.dll/.so/.dylib :
Date-time functions 139  functions and 27 variants

Preliminary note

Calculate 11 functions

Determin 78 functions and 23 variants

Format 16 functions and 4 variants

Compare 4 functions

Convert 7 functions

movable feasts 14 functions

doesn't run with InterBase

returns <null> instead of 0, '' (empty string) or '17.11.1858'

since InterBase 6.0 this function is substitutable with a native SQL statement

since FireBird 1.0 this function is substitutable with a native SQL statement

since FireBird 2.1 this function is substitutable with a native SQL statement


Output RETURN mechanism if nothing other is published: FREE_IT
TestSQLs with NULL run only in FireBird 2.
 
Date-time functions: Preliminary note
For calculation of time there are used different dates. The most importent are
- Julian Date (JD)
- modified Julian Date (MJD)
- Dubliner Julian Date (DJD)
- ANSI Date
- UNIX Time (POSIX-Standard)

The Julian Date (JD) is a continuous count of days and fractions elapsed since 1st Januar -4712 12:00. For example the 1st Januar 2000 12:00 is the julian date 2.451.545,0.
The julian date did'nt mistake with a date in the julian calendar.
As a continious count of days the julian date is free of irregularities like leap days, different length of month a.s.o. you can find in most of calendars. It is used mostly in astronomy to describe time-dependents for easy calculation of time-differences.

In international geophysical year (1957/1958) a modified Julian Date (mJD oder MJD) was established with zeropoint at 1985-11-17 0:00 UT(worldtime): MJD = JD – 2.400.000,5. It was first used to record the orbit of Sputnik via an IBM 704 (36-bit machine). Digital Equipment Corporation (DEC) used MJD in their OS VMS and their database Rdb/VMS, on which Jim Starkey cooperated before he leaves DEC and programmed his own RDBMS (relational database management system) (Groton DataBase), which becomes InterBase.
MJD is mainly used in geodesy, geophysics and space flight, but not become accepted in astronomy.

The Dublin Julian Date (DJD) is another version of the Julian Date. The count of days started with the beginning of the year 1900 (used in Microsoft Excel, Lotus-123, Delphi) or the the year 1904 (Microsoft Excel for Mac OS). Because the count starts on 1st Januar with 1, the correct zeropoint is 1899-12-31 0:00. Some programms make more confusion because they use 1900 as a leap year and therefore their dates after 28th february 1900 are wrong (zeropoint form them is 1899-12-30 0:00).

The ANSI-Date starts with 1st januar 1601 as day „1“. It's used in COBOL.

Unix time, or POSIX time, is a system for describing points in time: it is the number of seconds elapsed since midnight UTC of January 1, 1970, not counting leap seconds. This starting-time is called The EPOCH. It is widely used not only on Unix-like operating systems but also in many other computing systems.

(look http://en.wikipedia.org/wiki/Julian_date and http://en.wikipedia.org/wiki/Unix_time)

InterBase and FireBird uses the modified Julian Date with 1858-11-17 as day 0.
 
Date-time functions: Calculate
from
substitutable with DATEADD
F_ADDYEAR compatibility to FreeUDFLib, FreeUDFLibC, FreeUDFLib AvERP, GrUDF
Entrypoint addyear compatible with UTF-8
Input TIMESTAMP
INTEGER
date optionally time
years to add
Output TIMESTAMP adds years to timestamp
If parameter 2 is negativ, years where subtract.
If the outputyear is a non-leapyear, for input 29th February the output is 1st March.
TestSQL
SELECT '01.10.2008 15:03:01' AS ISCORRECT, F_ADDYEAR('01.10.2005 15:03:01', 3) FROM RDB$DATABASE;
SELECT '01.10.2002 15:03:01' AS ISCORRECT, F_ADDYEAR('01.10.2005 15:03:01', -3) FROM RDB$DATABASE;
SELECT '29.02.2008 15:03:01' AS ISCORRECT, F_ADDYEAR('29.02.2004 15:03:01', 4) FROM RDB$DATABASE;
SELECT '01.03.2009 15:03:01' AS ISCORRECT, F_ADDYEAR('29.02.2008 15:03:01', 1) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_ADDYEAR(NULL, NULL) FROM RDB$DATABASE;
nach oben • go top •
from
substitutable with DATEADD
F_ADDMONTH compatibility to FreeUDFLib, FreeUDFLibC, FreeUDFLib AvERP, GrUDF
Entrypoint addmonth compatible with UTF-8
Input TIMESTAMP
INTEGER
date optionally time
month to add
Output TIMESTAMP adds months to timestamp
If parameter 2 is negativ, months where subtract.
TestSQL
SELECT '01.03.2006 15:03:01' AS ISCORRECT, F_ADDMONTH('01.10.2005 15:03:01', 5) FROM RDB$DATABASE;
SELECT '01.07.2005 15:03:01' AS ISCORRECT, F_ADDMONTH('01.10.2005 15:03:01', -3) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_ADDMONTH(NULL, NULL) FROM RDB$DATABASE;
nach oben • go top •
from
substitutable with DATEADD
F_ADDWEEK function from adhoc
Entrypoint addweek compatible with UTF-8
Input TIMESTAMP
INTEGER
date optionally time
weeks to add
Output TIMESTAMP adds weeks to timestamp
If parameter 2 is negativ, weeks where subtract.
TestSQL
SELECT '22.10.2005 15:03:01' AS ISCORRECT, F_ADDWEEK('01.10.2005 15:03:01', 3) FROM RDB$DATABASE;
SELECT '10.09.2005 15:03:01' AS ISCORRECT, F_ADDWEEK('01.10.2005 15:03:01', -3) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_ADDWEEK(NULL, NULL) FROM RDB$DATABASE;
nach oben • go top •
from
substitutable with DATEADD
F_ADDDAY function from adhoc
Entrypoint addday compatible with UTF-8
Input TIMESTAMP
INTEGER
date optionally time
days to add
Output TIMESTAMP adds days to timestamp
If parameter 2 is negativ, days where subtract.
TestSQL
SELECT '04.10.2005 15:03:01' AS ISCORRECT, F_ADDDAY('01.10.2005 15:03:01', 3) FROM RDB$DATABASE;
SELECT '28.09.2005 15:03:01' AS ISCORRECT, F_ADDDAY('01.10.2005 15:03:01', -3) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_ADDDAY(NULL, NULL) FROM RDB$DATABASE;
nach oben • go top •
from
substitutable with DATEADD
F_ADDHOUR function from adhoc
Entrypoint addhour compatible with UTF-8
Input TIMESTAMP
INTEGER
date optionally time
hours to add
Output TIMESTAMP adds hours to timestamp
If parameter 2 is negativ, hours where subtract.
TestSQL
SELECT '01.10.2005 18:03:01' AS ISCORRECT, F_ADDHOUR('01.10.2005 15:03:01', 3) FROM RDB$DATABASE;
SELECT '01.10.2005 12:03:01' AS ISCORRECT, F_ADDHOUR('01.10.2005 15:03:01', -3) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_ADDHOUR(NULL, NULL) FROM RDB$DATABASE;
nach oben • go top •
from
substitutable with DATEADD
F_ADDMINUTE function from adhoc
Entrypoint addminute compatible with UTF-8
Input TIMESTAMP
INTEGER
date optionally time
minutes to add
Output TIMESTAMP adds minutes to timestamp
If parameter 2 is negativ, minutes where subtract.
TestSQL
SELECT '01.10.2005 15:06:01' AS ISCORRECT, F_ADDMINUTE('01.10.2005 15:03:01', 3) FROM RDB$DATABASE;
SELECT '01.10.2005 15:00:01' AS ISCORRECT, F_ADDMINUTE('01.10.2005 15:03:01', -3) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_ADDMINUTE(NULL, NULL) FROM RDB$DATABASE;
nach oben • go top •
from
substitutable with DATEADD
F_ADDSECOND function from adhoc
Entrypoint addsecond compatible with UTF-8
Input TIMESTAMP
INTEGER
date optionally time
seconds to add
Output TIMESTAMP adds seconds to timestamp
If parameter 2 is negativ, seconds where subtract.
TestSQL
SELECT '01.10.2005 15:03:04' AS ISCORRECT, F_ADDSECOND('01.10.2005 15:03:01', 3) FROM RDB$DATABASE;
SELECT '01.10.2005 15:02:58' AS ISCORRECT, F_ADDSECOND('01.10.2005 15:03:01', -3) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_ADDSECOND(NULL, NULL) FROM RDB$DATABASE;  
nach oben • go top •
F_INCDATE input/output-compatibility to rFunc (INCDATE)
Entrypoint incdate compatible with UTF-8
Input TIMESTAMP
INTEGER
INTEGER
INTEGER
date optionally time
days to add
month to add
years to add
Output TIMESTAMP Adds to parameter 1 days, month and years.
If parameters are negative they will be subtracted.
TestSQL
SELECT '02.11.2006 15:03:05' AS ISCORRECT, F_INCDATE('01.10.2005 15:03:05', 1, 1, 1) FROM RDB$DATABASE;
SELECT '31.08.2004 15:03:05' AS ISCORRECT, F_INCDATE('01.10.2005 15:03:05', -1, -1, -1) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_INCDATE(NULL, NULL, NULL, NULL) FROM RDB$DATABASE;  
nach oben • go top •
F_INCDATETIME input/output-compatibility to rFunc (INCDATETIME)
Entrypoint incdatetime compatible with UTF-8
Input TIMESTAMP
INTEGER
INTEGER
INTEGER
INTEGER
INTEGER
INTEGER
date optionally time
days to add
month to add
years to add
hours to add
minutes to add
seconds to add
Output TIMESTAMP Adds to parameter 1 days, month, years, hours, minutes and seconds.
If parameters are negative they will be subtracted.
TestSQL
SELECT '02.11.2006 16:04:06' AS ISCORRECT, F_INCDATETIME('01.10.2005 15:03:05', 1, 1, 1, 1, 1, 1) FROM RDB$DATABASE;
SELECT '02.11.2006 14:02:04' AS ISCORRECT, F_INCDATETIME('01.10.2005 15:03:05', 1, 1, 1, -1, -1, -1) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_INCDATETIME(NULL, NULL, NULL, NULL, NULL, NULL, NULL) FROM RDB$DATABASE;  
nach oben • go top •
F_ADDPERIOD function from adhoc
Entrypoint addperiod compatible with UTF-8
Input CSTRING(254)
CSTRING(254)
period 1 in pattern [d]:h:m:s
period 2 in pattern [d]:h:m:s
Output CSTRING(254) sum of period 1 and 2
Periods could be enter with 2- or 1digits interval (dd:hh:mm:ss or d:h:m:s).
Negative periods starts with a "-" in front.
Periods with pattern days:hours:minutes:seconds (4 intervalls) or hours:minutes:seconds (3 intervalls) are allowed.
The output of periods with less than 3 intervalls or containing other characters is <null> or empty string.
For input also f.e. '0:26:0:0' instead of '1:2:0:0' alllowed for 26 hours.
The output is allways in pattern days:hours:minutes:seconds (4 * 2 digit intervalls)
TestSQL
SELECT '00:01:25:10' AS ISCORRECT, F_ADDPERIOD('0:1:10:0', '0:0:15:10') FROM RDB$DATABASE;
SELECT '00:01:25:10' AS ISCORRECT, F_ADDPERIOD('01:10:00', '00:15:10') FROM RDB$DATABASE;
SELECT '00:00:54:50' AS ISCORRECT, F_SUBPERIOD('0:1:10:0', '0:0:15:10'), F_ADDPERIOD('0:1:10:0', '-0:0:15:10') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_ADDPERIOD(NULL, NULL) FROM RDB$DATABASE;  
nach oben • go top •
F_SUBPERIOD function from adhoc
Entrypoint subperiod compatible with UTF-8
Input CSTRING(254)
CSTRING(254)
period 1 in pattern [d]:h:m:s
period 2 in pattern [d]:h:m:s
Output CSTRING(254) period 2 subtracted from period 1
Periods could be enter with 2- or 1digits interval (dd:hh:mm:ss or d:h:m:s).
Negative periods starts with a "-" in front.
Periods with pattern days:hours:minutes:seconds (4 intervalls) or hours:minutes:seconds (3 intervalls) are allowed.
The output of periods with less than 3 intervalls or containing other characters is <null> or empty string.
For input also f.e. '0:26:0:0' instead of '1:2:0:0' alllowed for 26 hours.
The output is allways in pattern days:hours:minutes:seconds (4 * 2 digit intervalls).
If second input period is greater than first, the output is negativ ("-" in front).
TestSQL
SELECT '00:00:54:50' AS ISCORRECT, F_SUBPERIOD('0:1:10:0', '0:0:15:10') FROM RDB$DATABASE;
SELECT '-00:00:54:50' AS ISCORRECT, F_SUBPERIOD('0:0:15:10', '0:1:10:0') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_SUBPERIOD(NULL, NULL) FROM RDB$DATABASE;  
nach oben • go top •
 
Date-time functions: Determin
To calculate the difference between two timestamps there are 3 posibilities (can be used with all IB and FB-versions)
  • if you want a negative number if the first date is newer than the second date
    • use F_AGEIN... with the entrypoint agein...
  • if you want <null> if the first date is newer than the second date
    • use F_AGEIN...N with the entrypoint agein...null 
  • if you want every time a positv number in every case of input
    • use F_...BETWEEN with the entrypoint ...between
Input for all
TIMESTAMP
TIMESTAMP
(older) date optionally time 1
(newer) date optionally time 2
from
substitutable with DATEDIFF
F_AGEINYEARS
function from adhoc
Entrypoint ageinyears compatible with UTF-8
Output INTEGER difference in (integer) years between timestamp 1 and timestamp 2
from
substitutable with DATEDIFF
F_AGEINYEARSN function from adhoc
Entrypoint ageinyearsnull compatible with UTF-8
Output INTEGER difference in (integer) years between timestamp 1 and timestamp 2
from
substitutable with DATEDIFF
F_AGEINMONTHS
compatibility to FreeUDFLib, FreeUDFLibC, FreeUDFLib AvERP, GrUDF
Entrypoint ageinmonths compatible with UTF-8
Output INTEGER difference in (integer) months between timestamp 1 and timestamp 2
from

substitutable with DATEDIFF
F_AGEINMONTHSN function from adhoc
Entrypoint ageinmonthsnull compatible with UTF-8
Output INTEGER difference in (integer) months between timestamp 1 and timestamp 2
from
substitutable with DATEDIFF
F_AGEINWEEKS
compatibility to FreeUDFLib, FreeUDFLibC, FreeUDFLib AvERP
Entrypoint ageinweeks compatible with UTF-8
Output INTEGER difference in (integer) weeks between timestamp 1 and timestamp 2
Sunday is 1st day of week.
If the two dates are in the same week, the return value is 0.
F_AGEINWEEKSISO
function from adhoc
Entrypoint ageinweeksiso compatible with UTF-8
Output INTEGER difference in (integer) weeks between timestamp 1 and timestamp 2
ISO-version of F_AGEINWEEKS. Monday is 1st day of week.
If the two dates are in the same week, the return value is 0.
from
substitutable with DATEDIFF
F_AGEINWEEKSN function from adhoc
Entrypoint ageinweeksnull compatible with UTF-8
Output INTEGER difference in (integer) weeks between timestamp 1 and timestamp 2
Sunday is 1st day of week.
If the two dates are in the same week, the return value is 0
F_AGEINWEEKSNISO function from adhoc
Entrypoint ageinweeksnulliso compatible with UTF-8
Output INTEGER difference in (integer) weeks between timestamp 1 and timestamp 2
ISO-version of F_AGEINWEEKSN. Monday is 1st day of week.
If the two dates are in the same week, the return value is 0.
from
substitutable with DATEDIFF
F_AGEINDAYS
 
compatibility to FreeUDFLib, FreeUDFLib AvERP
input/output-compatibility to rFunc (DAYSBETWEEN)
Entrypoint ageindays compatible with UTF-8
Output INTEGER difference in (integer) days between timestamp 1 and timestamp 2
from
substitutable with DATEDIFF
F_AGEINDAYSN function from adhoc
Entrypoint ageindaysnull compatible with UTF-8
Output INTEGER difference in (integer) days between timestamp 1 and timestamp 2
F_AGEINWORKINGDAYS  function from adhoc
Entrypoint ageinworkingdays compatible with UTF-8
Input TIMESTAMP
TIMESTAMP
INTEGER
(older) date optionally time 1
(newer) date optionally time 2
weekday don't calculate
Output INTEGER difference in (integer) days between timestamp 1 and timestamp 2 less of weekday/s from param 3
weekday: Monday = 1, Thuesday = 2, Wednesday = 3, Thursday = 4, Friday = 5, Saturday = 6, Sunday = 7
If 1st date is newer than 2nd date, the result is negativ.
Any order of indexes for weekdays. Only allowed indexes are calculated.
Test SQL
SELECT 4 AS ISCORRECT, F_AGEINWORKINGDAYS('12.12.2008', '17.12.2008', 7) FROM RDB$DATABASE;
SELECT 3 AS ISCORRECT, F_AGEINWORKINGDAYS('12.12.2008', '17.12.2008', 67) FROM RDB$DATABASE;
SELECT -3 AS ISCORRECT, F_AGEINWORKINGDAYS('17.12.2008', '12.12.2008', 67) FROM RDB$DATABASE;
SELECT 3 AS ISCORRECT, F_AGEINWORKINGDAYS('12.12.2008', '17.12.2008', 467) FROM RDB$DATABASE;
SELECT 5 AS ISCORRECT, F_AGEINWORKINGDAYS('12.12.2008', '17.12.2008', 9) FROM RDB$DATABASE;
SELECT 5 AS ISCORRECT, F_AGEINWORKINGDAYS('12.12.2008', '17.12.2008', 890) FROM RDB$DATABASE;
SELECT 0 AS ISCORRECT, F_AGEINWORKINGDAYS('09.01.2009', '09.01.2009', 67) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_AGEINWORKINGDAYS(NULL, NULL, NULL) FROM RDB$DATABASE;
from
substitutable with DATEDIFF
F_AGEINHOURS
function from adhoc
Entrypoint ageinhours compatible with UTF-8
Output INTEGER difference in (integer) hours between timestamp 1 and timestamp 2
from
substitutable with DATEDIFF
F_AGEINHOURSN function from adhoc
Entrypoint ageinhoursnull compatible with UTF-8
Output INTEGER difference in (integer) hours between timestamp 1 and timestamp 2
from
substitutable with DATEDIFF
F_AGEINMINUTES
function from adhoc
Entrypoint ageinminutes compatible with UTF-8
Output INTEGER difference in (integer) minutes between timestamp 1 and timestamp 2
from
substitutable with DATEDIFF
F_AGEINMINUTESN function from adhoc
Entrypoint ageinminutesnull compatible with UTF-8
Output INTEGER difference in (integer) minutes between timestamp 1 and timestamp 2
from
substitutable with DATEDIFF
F_AGEINSECONDS
function from adhoc
Entrypoint ageinseconds compatible with UTF-8
Output INTEGER difference in (integer) seconds between timestamp 1 and timestamp 2
from
substitutable with DATEDIFF
F_AGEINSECONDSN function from adhoc
Entrypoint ageinsecondsnull compatible with UTF-8
Output INTEGER difference in (integer) seconds between timestamp 1 and timestamp 2
For compatibility reasons:
If date 2 < date 1 the result is negativ. The correct result had be 0 than there is no negative age!
Use F_AGEIN...N or F_...BETWEEN if you don't want a negative age.
TestSQL
SELECT 3 AS ISCORRECT, F_AGEINYEARS('01.01.2005 15:01:21','01.10.2008 15:01:01') FROM RDB$DATABASE;
SELECT -3 AS ISCORRECT, F_AGEINYEARS('01.01.2005 15:01:21','01.10.2002 15:01:01') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_AGEINYEARS(NULL, NULL) FROM RDB$DATABASE;
SELECT 9 AS ISCORRECT, F_AGEINMONTHS('01.01.2005 15:01:21','01.10.2005 15:01:01') FROM RDB$DATABASE;
SELECT -9 AS ISCORRECT, F_AGEINMONTHS('01.10.2005 15:01:21','01.01.2005 15:01:01') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_AGEINMONTHS(NULL, NULL) FROM RDB$DATABASE;
SELECT 20 AS ISCORRECT, F_AGEINWEEKS('01.01.2005 15:01:21','15.05.2005 15:01:21') FROM RDB$DATABASE;
SELECT -33 AS ISCORRECT, F_AGEINWEEKS('01.01.2006 15:01:21','15.05.2005 15:01:21') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_AGEINWEEKS(NULL, NULL) FROM RDB$DATABASE;
SELECT 10 AS ISCORRECT, F_AGEINDAYS('01.10.2005 15:01:03','11.10.2005 15:04:03') FROM RDB$DATABASE;
SELECT -20 AS ISCORRECT, F_AGEINDAYS('01.10.2005 15:01:03','11.09.2005 15:04:03') FROM RDB$DATABASE;
SELECT 3 AS ISCORRECT, F_AGEINHOURS('01.10.2005 15:01:03','01.10.2005 18:01:03') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_AGEINDAYS(NULL, NULL) FROM RDB$DATABASE;
SELECT 14 AS ISCORRECT, F_AGEINMINUTES('01.10.2005 15:01:03','01.10.2005 15:15:03') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_AGEINHOURS(NULL, NULL) FROM RDB$DATABASE;
SELECT 14 AS ISCORRECT, F_AGEINMINUTES('01.10.2005 15:01:03','01.10.2005 15:15:03') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_AGEINMINUTES(NULL, NULL) FROM RDB$DATABASE;
SELECT 20 AS ISCORRECT, F_AGEINSECONDS('01.01.2005 15:01:01','01.01.2005 15:01:21') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_AGEINSECONDS(NULL, NULL) FROM RDB$DATABASE;
nach oben • go top •
Input for all
TIMESTAMP
TIMESTAMP
INTEGER
INTEGER
INTEGER
INTEGER
(older) date optionally time 1
(newer) date optionally time 2
min. value
min. value is used (0 = no, 1 = yes)
max. value
max. value is used (0 = no, 1 = yes)
F_AGEINYEARSTHRESHOLD
function from adhoc
Entrypoint ageinyearsthreshold compatible with UTF-8
Output INTEGER difference in (integer) years between timestamp 1 and timestamp 2
F_AGEINYEARSTHRESHOLDN function from adhoc
Entrypoint ageinyearsthresholdnull compatible with UTF-8
Output INTEGER difference in (integer) years between timestamp 1 and timestamp 2
F_AGEINMONTHSTHRESHOLD
compatibility to FreeUDFLib, FreeUDFLib AvERP
Entrypoint ageinmonththreshold compatible with UTF-8
Output INTEGER difference in (integer) months between timestamp 1 and timestamp 2
F_AGEINMONTHSTHRESHOLDN function from adhoc
Entrypoint ageinmonththresholdnull compatible with UTF-8
Output INTEGER difference in (integer) months between timestamp 1 and timestamp 2
F_AGEINWEEKSTHRESHOLD
compatibility to FreeUDFLib, FreeUDFLib AvERP
Entrypoint ageinweeksthreshold compatible with UTF-8
Output INTEGER difference in (integer) weeks between timestamp 1 and timestamp 2
Sunday is 1st day of week.
If the two dates are in the same week, the return value is 0.
F_AGEINWEEKSTHRESHOLDISO
function from adhoc
Entrypoint ageinweeksthresholdiso compatible with UTF-8
Output INTEGER difference in (integer) weeks between timestamp 1 and timestamp 2
ISO-version of F_AGEINWEEKSTHRESDHOLD. Monday is 1st day of week.
If the two dates are in the same week, the return value is 0.
F_AGEINWEEKSTHRESHOLDN function from adhoc
Entrypoint ageinweeksthresholdnull compatible with UTF-8
Output INTEGER difference in (integer) weeks between timestamp 1 and timestamp 2
Sunday is 1st day of week.
If the two dates are in the same week, the return value is 0.
F_AGEINWEEKSTHRESHOLDNISO function from adhoc
Entrypoint ageinweeksthresholdnulliso compatible with UTF-8
Output INTEGER difference in (integer) weeks between timestamp 1 and timestamp 2
ISO-version of F_AGEINWEEKSTHRESDHOLDN. Monday is 1st day of week.
If the two dates are in the same week, the return value is 0.
F_AGEINDAYSTHRESHOLD
compatibility to FreeUDFLib, FreeUDFLib AvERP
Entrypoint ageindaysthreshold compatible with UTF-8
Output INTEGER difference in (integer) days between timestamp 1 and timestamp 2
F_AGEINDAYSTHRESHOLDN function from adhoc
Entrypoint ageindaysthresholdnull compatible with UTF-8
Output INTEGER difference in (integer) days between timestamp 1 and timestamp 2
F_AGEINWORKINGDAYSTHR function from adhoc
Entrypoint ageinworkingdaysthr compatible with UTF-8
Input TIMESTAMP
TIMESTAMP
INTEGER
INTEGER
INTEGER
INTEGER
INTEGER
(older) date optionally time 1
(newer) date optionally time 2
min. value
min. value is used (0 = no, 1 = yes)
max. value
max. value is used (0 = no, 1 = yes)
weekday don't calculate
Output INTEGER difference in (integer) days between timestamp 1 and timestamp 2 less of weekday/s from param 7
weekday: Monday = 1, Thuesday = 2, Wednesday = 3, Thursday = 4, Friday = 5, Saturday = 6, Sunday = 7
If 1st date is newer than 2nd date, the result is negativ.
Any order of indexes for weekdays. Only allowed indexes are calculated.
Test SQL
SELECT 4 AS ISCORRECT, F_AGEINWORKINGDAYSTHRESHOLD('12.12.2008', '17.12.2008', 5, 0, 0, 0, 7) FROM RDB$DATABASE;
SELECT 5 AS ISCORRECT, F_AGEINWORKINGDAYSTHRESHOLD('12.12.2008', '17.12.2008', 5, 1, 0, 0, 7) FROM RDB$DATABASE;
SELECT 4 AS ISCORRECT, F_AGEINWORKINGDAYSTHRESHOLD('12.12.2008', '17.12.2008', 0, 0, 3, 0, 7) FROM RDB$DATABASE;
SELECT 3 AS ISCORRECT, F_AGEINWORKINGDAYSTHRESHOLD('12.12.2008', '17.12.2008', 0, 0, 3, 1, 7) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_AGEINWORKINGDAYSTHR(NULL, NULL, NULL) FROM RDB$DATABASE;
F_AGEINHOURSTHRESHOLD
function from adhoc
Entrypoint ageinhoursthreshold compatible with UTF-8
Output INTEGER difference in (integer) hours between timestamp 1 and timestamp 2
F_AGEINHOURSTHRESHOLDN function from adhoc
Entrypoint ageinhoursthresholdnull compatible with UTF-8
Output INTEGER difference in (integer) hours between timestamp 1 and timestamp 2
F_AGEINMINUTESTHRESHOLD
function from adhoc
Entrypoint ageinminutesthreshold compatible with UTF-8
Output INTEGER difference in (integer) minutes between timestamp 1 and timestamp 2
F_AGEINMINUTESTHRESHOLDN function from adhoc
Entrypoint ageinminutesthresholdnull compatible with UTF-8
Output INTEGER difference in (integer) minutes between timestamp 1 and timestamp 2
F_AGEINSECONDSTHRESHOLD  function from adhoc
Entrypoint ageinsecondsthreshold compatible with UTF-8
Output INTEGER difference in (integer) seconds between timestamp 1 and timestamp 2
F_AGEINSECONDSTHRESHOLDN function from adhoc
Entrypoint ageinsecondsthresholdnull compatible with UTF-8
Output INTEGER difference in (integer) seconds between timestamp 1 and timestamp 2
Is parameter 4 (use min. value) set to 1, the result is minimum the value of parameter 3.
Is parameter 6 (use max. value) set to 1, the result is maximum the value of parameter 5.
For compatibility reasons:
If date 2 < date 1 the result is negativ. The correct result had be 0 than there is no negative age!
Use F_AGEIN...N or F_...BETWEEN if you don't want a negative age.
TestSQL
SELECT 3 AS ISCORRECT, F_AGEINYEARSTHRESHOLD('01.10.2005 15:01:03','01.12.2008 15:03:03', 5, 0, 10, 0) FROM RDB$DATABASE;
SELECT 5 AS ISCORRECT, F_AGEINYEARSTHRESHOLD('01.10.2005 15:01:03','01.12.2008 15:03:03', 5, 1, 10, 0) FROM RDB$DATABASE;
SELECT 3 AS ISCORRECT, F_AGEINYEARSTHRESHOLD('01.10.2005 15:01:03','01.12.2008 15:03:03', 5, 0, 10, 1) FROM RDB$DATABASE;
SELECT 10 AS ISCORRECT, F_AGEINYEARSTHRESHOLD('01.10.2005 15:01:03','01.12.2018 15:03:03', 5, 0, 10, 1) FROM RDB$DATABASE;
SELECT 10 AS ISCORRECT, F_AGEINYEARSTHRESHOLD('01.10.2005 15:01:03','01.12.2018 15:03:03', 5, 1, 10, 1) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_AGEINYEARSTHRESHOLD(NULL, NULL, NULL, NULL, NULL, NULL) FROM RDB$DATABASE;
SELECT 2 AS ISCORRECT, F_AGEINMONTHSTHRESHOLD('01.10.2005 15:01:03','01.12.2005 15:03:03', 5, 0, 10, 0) FROM RDB$DATABASE;
SELECT 5 AS ISCORRECT, F_AGEINMONTHSTHRESHOLD('01.10.2005 15:01:03','01.12.2005 15:03:03', 5, 1, 10, 0) FROM RDB$DATABASE;
SELECT 10 AS ISCORRECT, F_AGEINMONTHSTHRESHOLD('01.01.2005 15:01:03','01.12.2005 15:03:03', 5, 1, 10, 1) FROM RDB$DATABASE;
SELECT -1 AS ISCORRECT, F_AGEINMONTHSTHRESHOLD('01.01.2006 15:01:03','01.12.2005 15:03:03', 5, 0, 10, 0) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_AGEINMONTHSTHRESHOLD(NULL, NULL, NULL, NULL, NULL, NULL) FROM RDB$DATABASE;
SELECT 2 AS ISCORRECT, F_AGEINWEEKSTHRESHOLD('01.01.2005 15:01:21','15.01.2005 15:01:21', 5, 0, 10, 0) FROM RDB$DATABASE;
SELECT 5 AS ISCORRECT, F_AGEINWEEKSTHRESHOLD('01.01.2005 15:01:21',’15.01.2005 15:01:21', 5, 1, 10, 0) FROM RDB$DATABASE;
SELECT 10 AS ISCORRECT, F_AGEINWEEKSTHRESHOLD('01.01.2005 15:01:21','15.05.2005 15:01:21', 5, 0, 10, 1) FROM RDB$DATABASE;           
SELECT -33 AS ISCORRECT, F_AGEINWEEKSTHRESHOLD('01.01.2006 15:01:21','15.05.2005 15:01:21', 5, 0, 10, 1) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_AGEINWEEKSTHRESHOLD(NULL, NULL, NULL, NULL, NULL, NULL) FROM RDB$DATABASE;
SELECT 10 AS ISCORRECT, F_AGEINDAYSTHRESHOLD('01.10.2005 15:01:03','11.10.2005 15:01:03', 15, 0, 20, 0) FROM RDB$DATABASE;
SELECT 15 AS ISCORRECT, F_AGEINDAYSTHRESHOLD('01.10.2005 15:01:03','11.10.2005 15:01:03', 15, 1, 20, 0) FROM RDB$DATABASE;
SELECT 20 AS ISCORRECT, F_AGEINDAYSTHRESHOLD('01.10.2005 15:01:03','01.11.2005 15:01:03', 15, 0, 20, 1) FROM RDB$DATABASE;
SELECT 20 AS ISCORRECT, F_AGEINDAYSTHRESHOLD('01.10.2005 15:01:03','01.11.2005 15:01:03', 15, 1, 20, 1) FROM RDB$DATABASE;
SELECT 15 AS ISCORRECT, F_AGEINDAYSTHRESHOLD('01.10.2005 15:01:03','01.09.2005 15:01:03', 15, 1, -20, 1) FROM RDB$DATABASE;
SELECT -20 AS ISCORRECT, F_AGEINDAYSTHRESHOLD('01.10.2005 15:01:03','15.09.2005 15:01:03', 15, 0, -20, 1) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_AGEINDAYSTHRESHOLD(NULL, NULL, NULL, NULL, NULL, NULL) FROM RDB$DATABASE;
SELECT 3 AS ISCORRECT, F_AGEINHOURSTHRESHOLD('01.10.2005 15:01:03','01.10.2005 18:01:03', 5, 0, 10, 0) FROM RDB$DATABASE;
SELECT 5 AS ISCORRECT, F_AGEINHOURSTHRESHOLD('01.10.2005 15:01:03','01.10.2005 18:01:03', 5, 1, 10, 0) FROM RDB$DATABASE;
SELECT 10 AS ISCORRECT, F_AGEINHOURSTHRESHOLD('01.10.2005 15:01:03','02.10.2005 18:01:03', 5, 1, 10, 1) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_AGEINHOURSTHRESHOLD(NULL) FROM RDB$DATABASE;
SELECT 14 AS ISCORRECT, F_AGEINMINUTESTHRESHOLD('01.10.2005 15:01:03','01.10.2005 15:15:03', 5, 0, 10, 0) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_AGEINMINUTESTHRESHOLD(NULL, NULL, NULL, NULL, NULL, NULL) FROM RDB$DATABASE;
SELECT 16 AS ISCORRECT, F_AGEINSECONDSTHRESHOLD('01.01.2005 15:01:03','01.01.2005 15:01:19', 5, 0, 10, 0) FROM RDB$DATABASE;
SELECT 5 AS ISCORRECT, F_AGEINSECONDSTHRESHOLD('01.01.2005 15:01:19','01.01.2005 15:01:21', 5, 1, 10, 0) FROM RDB$DATABASE;
SELECT 10 AS ISCORRECT, F_AGEINSECONDSTHRESHOLD('01.01.2005 15:01:03','01.01.2005 15:01:19', 5, 1, 10, 1) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_AGEINSECONDSTHRESHOLD(NULL, NULL, NULL, NULL, NULL, NULL) FROM RDB$DATABASE;
nach oben • go top •
Input for all

TIMESTAMP
TIMESTAMP
date optionally time 1
date optionally time 2
F_YEARSBETWEEN compatibility to GrUDF
Entrypoint yearsbetween compatible with UTF-8
Output INTEGER difference in (integer) years between timestamp 1 and timestamp 2
F_MONTHSBETWEEN function from adhoc
Entrypoint monthsbetween compatible with UTF-8
Output INTEGER difference in (integer) months between timestamp 1 and timestamp 2
F_WEEKSBETWEEN compatibility to GrUDF
Entrypoint weeksbetween compatible with UTF-8
Output INTEGER difference in (integer) weeks between timestamp 1 and timestamp 2
Sunday is 1st day of week.
If the two dates are in the same week, the return value is 0.
F_WEEKSBETWEENISO function from adhoc
Entrypoint weeksbetweeniso compatible with UTF-8
Output INTEGER difference in (integer) weeks between timestamp 1 and timestamp 2
ISO-version of F_WEEKSBETWEEN. Monday is 1st day of week.
If the two dates are in the same week, the return value is 0.
F_DAYSBETWEEN function from adhoc
Entrypoint daysbetween compatible with UTF-8
Output INTEGER difference in (integer) days between timestamp 1 and timestamp 2
F_WORKINGDAYSBETWEEN function from adhoc
Entrypoint workingdaysbetween compatible with UTF-8
Input TIMESTAMP
TIMESTAMP
INTEGER
date optionally time 1
date optionally time 2
weekday don't calculate
Output INTEGER difference in (integer) days between timestamp 1 and timestamp 2 less of weekday/s from param 3
weekday: Monday = 1, Thuesday = 2, Wednesday = 3, Thursday = 4, Friday = 5, Saturday = 6, Sunday = 7
The result is allways positiv.
Any order of indexes for weekdays. Only allowed indexes are calculated.
Test SQL
SELECT 4 AS ISCORRECT, F_WORKINGDAYSBETWEEN('12.12.2008', '17.12.2008', 7) FROM RDB$DATABASE;
SELECT 4 AS ISCORRECT, F_WORKINGDAYSBETWEEN('17.12.2008', '12.12.2008', 7) FROM RDB$DATABASE;
SELECT -4 AS ISCORRECT, F_AGEINWORKINGDAYS('17.12.2008', '12.12.2008', 7) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_WORKINGDAYSBETWEEN(NULL, NULL, NULL) FROM RDB$DATABASE;
F_HOURSBETWEEN compatibility to GrUDF
Entrypoint hoursbetween compatible with UTF-8
Output INTEGER difference in (integer) hours between timestamp 1 and timestamp 2
F_MINUTESBETWEEN compatibility to GrUDF
Entrypoint minutesbetween compatible with UTF-8
Output INTEGER difference in (integer) minutes between timestamp 1 and timestamp 2
F_INDMINUTESBETWEEN function from adhoc
Entrypoint indminutesbetween compatible with UTF-8
Output INTEGER difference in (integer) industryminutes between timestamp 1 and timestamp 2
doesn't run with InterBase - please use F_INDMINUTESBETWEENTHRIB
F_INDMINUTESBETWEENTHR function from adhoc
Input TIMESTAMP
TIMESTAMP
TIME
INTEGER
TIME
INTEGER
date optionally time 1
date optionally time 2
min. time
min. time is used (0 = no, 1 = yes)
max. time
max. time is used (0 = no, 1 = yes)
Entrypoint indminutesbetweenthr compatible with UTF-8
Output INTEGER difference in (integer) industryminutes between timestamp 1 and timestamp 2

special-version for InterBase (also usable with FireBird)
F_INDMINUTESBETWEENTHRIB function from adhoc
Input TIMESTAMP
TIMESTAMP
TIMESTAMP !!!
INTEGER
TIMESTAMP !!!
INTEGER
date optionally time 1
date optionally time 2
min. timestamp
min. time is used (0 = no, 1 = yes)
max. timestamp
max. time is used (0 = no, 1 = yes)
Entrypoint indminutesbetweenthrib compatible with UTF-8
Output INTEGER difference in (integer) industryminutes between timestamp 1 and timestamp 2
F_SECONDSBETWEEN compatibility to GrUDF
Entrypoint secondsbetween compatible with UTF-8
Output INTEGER difference in (integer) seconds between timestamp 1 and timestamp 2
The result is always positiv values in difference to F_AGEIN.. which can also return negativ values.
TestSQL
SELECT 2 AS ISCORRECT, F_YEARSBETWEEN('01.10.2005 15:01:03','11.10.2007 15:01:03') FROM  RDB$DATABASE;
SELECT 2 AS ISCORRECT, F_YEARSBETWEEN('11.10.2007 15:01:03','01.10.2005 15:01:03') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_YEARSBETWEEN(NULL, NULL) FROM RDB$DATABASE;
SELECT 1 AS ISCORRECT, F_MONTHSBETWEEN('01.10.2005 15:01:03','11.11.2005 15:01:03') FROM RDB$DATABASE;
SELECT 1 AS ISCORRECT, F_MONTHSBETWEEN('11.11.2005 15:01:03','01.10.2005 15:01:03') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_MONTHSBETWEEN(NULL, NULL) FROM RDB$DATABASE;
SELECT 2 AS ISCORRECT, F_WEEKSBETWEEN('01.10.2005 15:01:03','11.10.2005 15:01:03') FROM RDB$DATABASE;
SELECT 2 AS ISCORRECT, F_WEEKSBETWEEN('11.10.2005 15:01:03',’01.10.2005 15:01:03') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_WEEKSBETWEEN(NULL, NULL) FROM RDB$DATABASE;
SELECT 10 AS ISCORRECT, F_DAYSBETWEEN('01.10.2005 15:01:03','11.10.2005 15:01:03') FROM RDB$DATABASE;
SELECT 10 AS ISCORRECT, F_DAYSBETWEEN('11.10.2005 15:01:03','01.10.2005 15:01:03') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_DAYSBETWEEN(NULL, NULL) FROM RDB$DATABASE;
SELECT 240 AS ISCORRECT, F_HOURSBETWEEN('01.10.2005 15:01:03','11.10.2005 15:04:03') FROM RDB$DATABASE;
SELECT 240 AS ISCORRECT, F_HOURSBETWEEN('11.10.2005 15:04:03','01.10.2005 15:01:03') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_HOURSBETWEEN(NULL, NULL) FROM RDB$DATABASE;
SELECT 3 AS ISCORRECT, F_MINUTESBETWEEN('01.10.2005 15:01:03','01.10.2005 15:04:03') FROM RDB$DATABASE;
SELECT 3 AS ISCORRECT, F_MINUTESBETWEEN('01.10.2005 15:04:03', '01.10.2005 15:01:03') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_MINUTESBETWEEN(NULL, NULL) FROM RDB$DATABASE;
SELECT 800 AS ISCORRECT, F_INDMINUTESBETWEEN('08.11.2008 16:00:00', '08.11.2008 08:00:00') FROM RDB$DATABASE;
SELECT 800 AS ISCORRECT, F_INDMINUTESBETWEEN('08.11.2008 08:00:00', '08.11.2008 16:00:00') FROM RDB$DATABASE;
SELECT 808 AS ISCORRECT, F_INDMINUTESBETWEEN('08.11.2008 08:00:00', '08.11.2008 16:05:29') FROM RDB$DATABASE;
SELECT 810 AS ISCORRECT, F_INDMINUTESBETWEEN('08.11.2008 08:00:00', '08.11.2008 16:05:30') FROM RDB$DATABASE;
SELECT 818 AS ISCORRECT, F_INDMINUTESBETWEEN('08.11.2008 07:55:00', '08.11.2008 16:05:30') FROM RDB$DATABASE;
SELECT 817 AS ISCORRECT, F_INDMINUTESBETWEEN('08.11.2008 07:55:00', '08.11.2008 16:05:00') FROM RDB$DATABASE;
SELECT 800 AS ISCORRECT, F_INDMINUTESBETWEENTHR('08.11.2008 07:55:00', '08.11.2008 16:05:00', '08:00', 1, '16:00', 1) FROM RDB$DATABASE;
SELECT 808 AS ISCORRECT, F_INDMINUTESBETWEENTHR('08.11.2008 07:55:00', '08.11.2008 16:05:00', '08:00', 0, '16:00', 1) FROM RDB$DATABASE;
SELECT 808 AS ISCORRECT, F_INDMINUTESBETWEENTHR('08.11.2008 16:05:00', '08.11.2008 07:55:00', '08:00', 0, '16:00', 1) FROM RDB$DATABASE;
SELECT 817 AS ISCORRECT, F_INDMINUTESBETWEENTHR('08.11.2008 07:55:00', '08.11.2008 16:05:00', '08:00', 0, '16:00', 0) FROM RDB$DATABASE;
SELECT 817 AS ISCORRECT, F_INDMINUTESBETWEENTHR('08.11.2008 07:55:00', '08.11.2008 16:05:00', '00:00', 0, '00:00', 0) FROM RDB$DATABASE;
SELECT 817 AS ISCORRECT, F_INDMINUTESBETWEENTHR('08.11.2008 07:55:00', '08.11.2008 16:05:00', null, null, null, null) FROM RDB$DATABASE;
SELECT 817 AS ISCORRECT, F_INDMINUTESBETWEENTHR('08.11.2008 16:05:00', '08.11.2008 07:55:00', null, null, null, null) FROM RDB$DATABASE;
SELECT 800 AS ISCORRECT, F_INDMINUTESBETWEENTHR('08.11.2008 21:55:00', '09.11.2008 06:05:00', '22:00', 1, '06:00', 1) FROM RDB$DATABASE;
SELECT 808 AS ISCORRECT, F_INDMINUTESBETWEENTHR('08.11.2008 21:55:00', '09.11.2008 06:05:00', '22:00', 1, '06:00', null) FROM RDB$DATABASE;
SELECT 800 AS ISCORRECT, F_INDMINUTESBETWEENTHR('08.11.2008 07:55:00', '08.11.2008 16:05:00', '08:00', 1, '16:00', 1) FROM RDB$DATABASE;
SELECT 808 AS ISCORRECT, F_INDMINUTESBETWEENTHR('08.11.2008 07:55:00', '08.11.2008 16:05:00', '08:00', 0, '16:00', 1) FROM RDB$DATABASE;
SELECT 817 AS ISCORRECT, F_INDMINUTESBETWEENTHR('08.11.2008 07:55:00', '08.11.2008 16:05:00', '08:00', 0, '16:00', 0) FROM RDB$DATABASE;
SELECT 818 AS ISCORRECT, F_INDMINUTESBETWEENTHR('08.11.2008 07:55:00', '08.11.2008 16:05:30', '08:00', 0, '16:00', 0) FROM RDB$DATABASE;
SELECT 180 AS ISCORRECT, F_SECONDSBETWEEN('01.10.2005 15:01:03','01.10.2005 15:04:03') FROM RDB$DATABASE;
SELECT 180 AS ISCORRECT, F_SECONDSBETWEEN('01.10.2005 15:04:03','01.10.2005 15:01:03') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_SECONDSBETWEEN(NULL, NULL) FROM RDB$DATABASE;
nach oben • go top •
from ersetzbar durch EXTRACT(YEARDAY FROM ...)
F_DAYOFYEAR
F_EXTRACTYEARDAY
compatibility to FreeUDFLib, FreeUDFLibC, FreeUDFLib AvERP, GrUDF
input/output-compatibility to rFunc (EXTRACTYEARDAY)
Entrypoint dayofyear compatible with UTF-8
Input TIMESTAMP date optionally time 
Output INTEGER number of days (day number x of the year) up to the selected timestamp
F_DAYOFYEAR: counting starts with 1
F_EXTRACTYEARDAY: counting starts with 0

TestSQL
SELECT 235 AS ISCORRECT, F_DAYOFYEAR('22.08.2004') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_DAYOFYEAR(NULL) FROM RDB$DATABASE;
SELECT 234 AS ISCORRECT, F_EXTRACTYEARDAY('22.08.2004'), F_DAYOFYEAR('22.08.2004') FROM RDB$DATABASE;
nach oben • go top •
from ersetzbar durch EXTRACT(DAY FROM ...)
F_DAYOFMONTH
compatibility to FreeUDFLib, FreeUDFLibC, FreeUDFLib AvERP, GrUDF
input/output-compatibility to rFunc (EXTRACTDAY)
Entrypoint dayofmonth compatible with UTF-8
Input TIMESTAMP date optionally time 
Output INTEGER day of the month
Counting starts with 1
TestSQL
SELECT 23 AS ISCORRECT, F_DAYOFMONTH('23.08.2004') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_DAYOFMONTH(NULL) FROM RDB$DATABASE;
nach oben • go top •
from ersetzbar durch EXTRACT(WEEKDAY FROM ...)
F_DAYOFWEEK
compatibility to FreeUDFLib, FreeUDFLibC, FreeUDFLib AvERP, GrUD
Entrypoint dayofweek compatible with UTF-8
F_EXTRACTWEEKDAY input/output-compatibility to rFunc (EXTRACTWEEKDAY)
Entrypoint r_weekday compatible with UTF-8
F_DOW
input/output-compatibility to rFunc (DOW)
Entrypoint r_dow compatible with UTF-8
Input TIMESTAMP date optionally time 
Output INTEGER day of the week as integer
F_DAYOFWEEK: Sunday = 1, Monday = 2, Thuesday = 3, Wednesday = 4, Thursday = 5, Friday = 6, Saturday = 7
F_EXTRACTWEEKDAY: Sunday = 0, Monday = 1, Thuesday = 2, Wednesday = 3, Thursday = 4, Friday = 5, Saturday = 6
F_DOW: Sunday = 7, Monday = 1, Thuesday = 2, Wednesday = 3, Thursday = 4, Friday = 5, Saturday = 6
TestSQL
SELECT 1 AS ISCORRECT, F_DAYOFWEEK('22.08.2004') FROM RDB$DATABASE;
SELECT NULL  AS ISCORRECT, F_DAYOFWEEK(NULL) FROM RDB$DATABASE;
SELECT 0 AS ISCORRECT, F_EXTRACTWEEKDAY('22.08.2004'), F_DAYOFWEEK('22.08.2004') FROM RDB$DATABASE;
SELECT 7 AS ISCORRECT, F_DOW('22.08.2004') FROM RDB$DATABASE;
nach oben • go top •
F_DAYSOFMONTH function from adhoc
input/output-compatibility to rFunc (DAYPERMONTH)
Entrypoint daysofmonth compatible with UTF-8
Input INTEGER
INTEGER
month
year
Output INTEGER amount of days (last day) in the month of the year
Counting starts with 1
TestSQL
SELECT 29 AS ISCORRECT, F_DAYSOFMONTH(2, 2004) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_DAYSOFMONTH(NULL, NULL) FROM RDB$DATABASE;
nach oben • go top •
F_LASTDAY compatibility to GrUDF
Entrypoint lastday compatible with UTF-8
Input INTEGER
INTEGER
year
month
Output INTEGER last day in the month of a year
Counting starts with 1
(nearly) identcall to F_DAYSOFMONTH, only swapped parameters
TestSQL
SELECT 29 AS ISCORRECT, F_LASTDAY(2004, 2) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_LASTDAY(NULL, NULL) FROM RDB$DATABASE;
nach oben • go top •
F_FIRSTDAYQUARTER function from adhoc
Entrypoint firstdayquarter compatible with UTF-8
Input TIMESTAMP date optionally time
Output TIMESTAMP date of 1st day of quarter as date with time 00:00:00
TestSQL
SELECT '01.07.2008' AS ISCORRECT, F_FIRSTDAYQUARTER('06.09.2008 15:00:00') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_FIRSTDAYQUARTER(NULL) FROM RDB$DATABASE;
nach oben • go top •
F_LASTDAYQUARTER function from adhoc
Entrypoint lastdayquarter compatible with UTF-8
Input TIMESTAMP date optionally time
Output TIMESTAMP date of last day of quarter with data and time 00:00:00
TestSQL
SELECT '30.09.2008' AS ISCORRECT, F_LASTDAYQUARTER('06.09.2008 15:00:00') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_LASTDAYQUARTER(NULL) FROM RDB$DATABASE;
nach oben • go top •
F_FIRSTDAYMONTH input/output-compatibility to rFunc (FIRSTDAYMONTH)
Entrypoint firstdaymonth compatible with UTF-8
Input TIMESTAMP date optionally time
Output TIMESTAMP Date with 1st day of month as date with time 00:00:00
TestSQL
SELECT '01.01.2007 00:00:00' AS ISCORRECT, F_FIRSTDAYMONTH('03.01.2007 15:00:00') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_FIRSTDAYMONTH(NULL) FROM RDB$DATABASE;
nach oben • go top •
F_LASTDAYMONTH input/output-compatibility to rFunc (LASTDAYMONTH)
Entrypoint lastdaymonth compatible with UTF-8
Input TIMESTAMP date optionally time
Output TIMESTAMP Date with last of the month as date with time 00:00:00
TestSQL
SELECT '31.01.2007 00:00:00' AS ISCORRECT, F_LASTDAYMONTH('03.01.2007 15:00:00') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_LASTDAYMONTH(NULL) FROM RDB$DATABASE;
nach oben • go top •
F_FIRSTDAYWEEK function from adhoc
Entrypoint firstdayweek compatible with UTF-8
Input TIMESTAMP date optionally time 
Output TIMESTAMP Date with 1st day of (US)weekday (Sunday) as date with time 00:00:00
TestSQL
SELECT '21.12.2008' AS ISCORRECT, F_FIRSTDAYWEEK('26.12.2008 15:00:00') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_FIRSTDAYWEEK(NULL) FROM RDB$DATABASE;
nach oben • go top •
F_LASTDAYWEEK function from adhoc
Entrypoint lastdayweek compatible with UTF-8
Input TIMESTAMP date optionally time 
Output TIMESTAMP Date with last day of (US)weekday (Saturday) as date with time 00:00:00
TestSQL
SELECT '27.12.2008' AS ISCORRECT, F_LASTDAYWEEK('26.12.2008 15:00:00') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_LASTDAYWEEK(NULL) FROM RDB$DATABASE;
nach oben • go top •
F_FIRSTDAYWEEKISO function from adhoc
Entrypoint firstdayweekiso compatible with UTF-8
Input TIMESTAMP date optionally time 
Output TIMESTAMP Date with 1st day of (ISO)weekday (Monday) as date with time 00:00:00
TestSQL
SELECT '22.12.2008' AS ISCORRECT, F_FIRSTDAYWEEKISO('26.12.2008 15:00:00') FROM RDB$DATABASE;
SELECT '29.12.2008' AS ISCORRECT, F_FIRSTDAYWEEKISO('03.01.2009 15:00:00') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_FIRSTDAYWEEKISO(NULL) FROM RDB$DATABASE;
nach oben • go top •
F_LASTDAYWEEKISO function from adhoc
Entrypoint lastdayweekiso compatible with UTF-8
Input TIMESTAMP date optionally time 
Output TIMESTAMP Date with last day of (ISO)weekday (Sunday) as date with time 00:00:00
TestSQL
SELECT '28.12.2008' AS ISCORRECT, F_LASTDAYWEEKISO('26.12.2008 15:00:00') FROM RDB$DATABASE;
SELECT '04.01.2009' AS ISCORRECT, F_LASTDAYWEEKISO('29.12.2008 15:00:00') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_LASTDAYWEEKISO(NULL) FROM RDB$DATABASE;
nach oben • go top •
F_FIRSTDAYWOY function from adhoc
Entrypoint firstdaywoy compatible with UTF-8
Input TIMESTAMP date optionally time 
Output TIMESTAMP Date with 1st day of (US)week of the year as date with time 00:00:00
TestSQL
SELECT '26.12.2004' AS ISCORRECT, F_FIRSTDAYWOY(1, 2005) FROM RDB$DATABASE;;
SELECT NULL AS ISCORRECT, F_FIRSTDAYWOY(NULL) FROM RDB$DATABASE;
nach oben • go top •
F_LASTDAYWOY Funktion von adhoc
Entrypoint lastdaywoy compatible with UTF-8
Input TIMESTAMP date optionally time 
Output TIMESTAMP Date with last day of (US)week of the year as date with time 00:00:00
TestSQL
SELECT '01.01.2005' AS ISCORRECT, F_LASTDAYWOY(1, 2005) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_LASTDAYWOY(NULL) FROM RDB$DATABASE;
nach oben • go top •
F_FIRSTDAYKW function from adhoc
Entrypoint firstdaykw compatible with UTF-8
Input TIMESTAMP date optionally time 
Output TIMESTAMP Date with 1st day of (ISO)week of the year as date with time 00:00:00
TestSQL
SELECT '27.12.2004' AS ISCORRECT, F_FIRSTDAYKW(53, 2004) FROM RDB$DATABASE;
SELECT '03.01.2005' AS ISCORRECT, F_FIRSTDAYKW(1, 2005) FROM RDB$DATABASE;
SELECT '28.04.2008' AS ISCORRECT, F_FIRSTDAYKW(18, 2008) FROM RDB$DATABASE;
SELECT '23.03.2009' AS ISCORRECT, F_FIRSTDAYKW(13, 2009) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_FIRSTDAYKW(NULL) FROM RDB$DATABASE;
nach oben • go top •
F_LASTDAYKW function from adhoc
Entrypoint lastdaykw compatible with UTF-8
Input TIMESTAMP date optionally time 
Output TIMESTAMP Date with last day of (ISO)week of the year as date with time 00:00:00
TestSQL
SELECT '02.01.2005' AS ISCORRECT, F_LASTDAYKW(53, 2004) FROM RDB$DATABASE;
SELECT '09.01.2005' AS ISCORRECT, F_LASTDAYKW(1, 2005) FROM RDB$DATABASE;
SELECT '04.05.2008' AS ISCORRECT, F_LASTDAYKW(18, 2008) FROM RDB$DATABASE;
SELECT '29.03.2009' AS ISCORRECT, F_LASTDAYKW(13, 2009) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_LASTDAYKW(NULL) FROM RDB$DATABASE;
nach oben • go top •
F_FIRSTDAYLASTQUARTER function from adhoc
Entrypoint firstdaylastquarter compatible with UTF-8
Input TIMESTAMP date optionally time
Output TIMESTAMP date of 1st day of last quarter as date with time 00:00:00
TestSQL
SELECT '01.01.2009' AS ISCORRECT, F_FIRSTDAYLASTQUARTER('08.05.2009 15:00:00') FROM RDB$DATABASE;
SELECT '01.10.2008' AS ISCORRECT, F_FIRSTDAYLASTQUARTER('08.02.2009 15:00:00') FROM RDB$DATABASE;
nach oben • go top •
F_LASTDAYLASTQUARTER function from adhoc
Entrypoint lastdaylastquarter compatible with UTF-8
Input TIMESTAMP date optionally time
Output TIMESTAMP date of ladt day of last quarter as date with time 00:00:00
TestSQL
SELECT '31.03.2009' AS ISCORRECT, F_LASTDAYLASTQUARTER('08.05.2009 15:00:00') FROM RDB$DATABASE;
SELECT '31.12.2008' AS ISCORRECT, F_LASTDAYLASTQUARTER('08.02.2009 15:00:00') FROM RDB$DATABASE;
nach oben • go top •
F_FIRSTDAYLASTMONTH input/output-compatibility to rFunc (FIRSTDAYMONTH)
Entrypoint firstdaylastmonth compatible with UTF-8
Input TIMESTAMP date optionally time
Output TIMESTAMP date of 1st day of last month as date with time 00:00:00
TestSQL
SELECT '01.04.2009' AS ISCORRECT, F_FIRSTDAYLASTMONTH('08.05.2009 15:00:00') FROM RDB$DATABASE;
SELECT '01.12.2008' AS ISCORRECT, F_FIRSTDAYLASTMONTH('03.01.2009 15:00:00') FROM RDB$DATABASE;
nach oben • go top •
F_LASTDAYLASTMONTH input/output-compatibility to rFunc (LASTDAYMONTH)
Entrypoint lastdaylastmonth compatible with UTF-8
Input TIMESTAMP date optionally time
Output TIMESTAMP date of last day of last month as date with time 00:00:00
TestSQL
SELECT '30.04.2009' AS ISCORRECT, F_LASTDAYLASTMONTH('08.05.2009 15:00:00') FROM RDB$DATABASE;
SELECT '31.12.2008' AS ISCORRECT, F_LASTDAYLASTMONTH('03.01.2009 15:00:00') FROM RDB$DATABASE;
nach oben • go top •
F_FIRSTDAYLASTWEEK function from adhoc
Entrypoint firstdaylastweek compatible with UTF-8
Input TIMESTAMP date optionally time
Output TIMESTAMP date of 1st day of last week (US)weekday (Sunday) as date with time 00:00:00
TestSQL
SELECT '26.04.2009' AS ISCORRECT, F_FIRSTDAYLASTWEEK('08.05.2009 15:00:00') FROM RDB$DATABASE;
SELECT '21.12.2008' AS ISCORRECT, F_FIRSTDAYLASTWEEK('02.01.2009 15:00:00') FROM RDB$DATABASE;
nach oben • go top •
F_LASTDAYLASTWEEK function from adhoc
Entrypoint lastdaylastweek compatible with UTF-8
Input TIMESTAMP date optionally time
Output TIMESTAMP date of last day of last week (US)weekday (Saturday) as date with time 00:00:00
TestSQL
SELECT '02.05.2009' AS ISCORRECT, F_LASTDAYLASTWEEK('08.05.2009 15:00:00') FROM RDB$DATABASE;
SELECT '27.12.2008' AS ISCORRECT, F_LASTDAYLASTWEEK('02.01.2009 15:00:00') FROM RDB$DATABASE;
nach oben • go top •
F_FIRSTDAYLASTWEEKISO function from adhoc
Entrypoint firstdaylastweekiso compatible with UTF-8
Input TIMESTAMP date optionally time
Output TIMESTAMP date of 1st day of last week (ISO)weekday (Monday) as date with time 00:00:00
TestSQL
SELECT '27.04.2009' AS ISCORRECT, F_FIRSTDAYLASTWEEKISO('08.05.2009 15:00:00') FROM RDB$DATABASE;
SELECT '22.12.2008' AS ISCORRECT, F_FIRSTDAYLASTWEEKISO('02.01.2009 15:00:00') FROM RDB$DATABASE;
nach oben • go top •
F_LASTDAYLASTWEEKISO function from adhoc
Entrypoint lastdaylastweekiso compatible with UTF-8
Input TIMESTAMP date optionally time
Output TIMESTAMP date of last day of last week (ISO)weekday (Sunday) as date with time 00:00:00
TestSQL
SELECT '03.05.2009' AS ISCORRECT, F_LASTDAYLASTWEEKISO('08.05.2009 15:00:00') FROM RDB$DATABASE;
SELECT '28.12.2008' AS ISCORRECT, F_LASTDAYLASTWEEKISO('02.01.2009 15:00:00') FROM RDB$DATABASE;
nach oben • go top •
F_FIRSTDAYNEXTQUARTER function from adhoc
Entrypoint firstdaynextquarter compatible with UTF-8
Input TIMESTAMP date optionally time
Output TIMESTAMP date of 1st day of next quarter as date with time 00:00:00
TestSQL
SELECT '01.07.2009' AS ISCORRECT, F_FIRSTDAYNEXTQUARTER('08.05.2009 15:00:00') FROM RDB$DATABASE;
SELECT '01.01.2010' AS ISCORRECT, F_FIRSTDAYNEXTQUARTER('08.11.2009 15:00:00') FROM RDB$DATABASE;
nach oben • go top •
F_LASTDAYNEXTQUARTER function from adhoc
Entrypoint lastdaynextquarter compatible with UTF-8
Input TIMESTAMP date optionally time
Output TIMESTAMP date of last day of next quarter as date with time 00:00:00
TestSQL
SELECT '30.09.2009' AS ISCORRECT, F_LASTDAYNEXTQUARTER('08.05.2009 15:00:00') FROM RDB$DATABASE;
SELECT '31.03.2010' AS ISCORRECT, F_LASTDAYNEXTQUARTER('08.11.2009 15:00:00') FROM RDB$DATABASE;
nach oben • go top •
F_FIRSTDAYNEXTMONTH input/output-compatibility to rFunc (FIRSTDAYMONTH)
Entrypoint firstdaynextmonth compatible with UTF-8
Input TIMESTAMP date optionally time
Output TIMESTAMP date of 1st day of next month as date with time 00:00:00
TestSQL
SELECT '01.06.2009' AS ISCORRECT, F_FIRSTDAYNEXTMONTH('08.05.2009 15:00:00') FROM RDB$DATABASE;
SELECT '01.01.2010' AS ISCORRECT, F_FIRSTDAYNEXTMONTH('08.12.2009 15:00:00') FROM RDB$DATABASE;
nach oben • go top •
F_LASTDAYNEXTMONTH input/output-compatibility to rFunc (LASTDAYMONTH)
Entrypoint lastdaynextmonth compatible with UTF-8
Input TIMESTAMP date optionally time
Output TIMESTAMP date of last day of next month as date with time 00:00:00
TestSQL
SELECT '30.06.2009' AS ISCORRECT, F_LASTDAYNEXTMONTH('08.05.2009 15:00:00') FROM RDB$DATABASE;
SELECT '31.01.2010' AS ISCORRECT, F_LASTDAYNEXTMONTH('08.12.2009 15:00:00') FROM RDB$DATABASE;
nach oben • go top •
F_FIRSTDAYNEXTWEEK function from adhoc
Entrypoint firstdaynextweek compatible with UTF-8
Input TIMESTAMP date optionally time
Output TIMESTAMP date of 1st day of next week (US)weekday (Sunday) as date with time 00:00:00
TestSQL
SELECT '10.05.2009' AS ISCORRECT, F_FIRSTDAYNEXTWEEK('08.05.2009 15:00:00') FROM RDB$DATABASE;
SELECT '04.01.2009' AS ISCORRECT, F_FIRSTDAYNEXTWEEK('30.12.2008 15:00:00') FROM RDB$DATABASE;
nach oben • go top •
F_LASTDAYNEXTWEEK function from adhoc
Entrypoint lastdaynextweek compatible with UTF-8
Input TIMESTAMP date optionally time
Output TIMESTAMP date of last day of next week (US)weekday (Saturday) as date with time 00:00:00
TestSQL
SELECT '16.05.2009' AS ISCORRECT, F_LASTDAYNEXTWEEK('08.05.2009 15:00:00') FROM RDB$DATABASE;
SELECT '10.01.2009' AS ISCORRECT, F_LASTDAYNEXTWEEK('30.12.2008 15:00:00') FROM RDB$DATABASE;
nach oben • go top •
F_FIRSTDAYNEXTWEEKISO function from adhoc
Entrypoint firstdaynextweekiso compatible with UTF-8
Input TIMESTAMP date optionally time
Output TIMESTAMP date of 1st day of next week (ISO)weekday (Monday) as date with time 00:00:00
TestSQL
SELECT '11.05.2009' AS ISCORRECT, F_FIRSTDAYNEXTWEEKISO('08.05.2009 15:00:00') FROM RDB$DATABASE;
SELECT '05.01.2009' AS ISCORRECT, F_FIRSTDAYNEXTWEEKISO('30.12.2008 15:00:00') FROM RDB$DATABASE;
nach oben • go top •
F_LASTDAYNEXTWEEKISO function from adhoc
Entrypoint lastdaynextweekiso compatible with UTF-8
Input TIMESTAMP date optionally time
Output TIMESTAMP date of last day of next week (ISO)weekday (Sunday) as date with time 00:00:00
TestSQL
SELECT '17.05.2009' AS ISCORRECT, F_LASTDAYNEXTWEEKISO('08.05.2009 15:00:00') FROM RDB$DATABASE;
SELECT '11.01.2009' AS ISCORRECT, F_LASTDAYNEXTWEEKISO('30.12.2008 15:00:00') FROM RDB$DATABASE;
nach oben • go top •
F_DTIME function from adhoc
Entrypoint dtime compatible with UTF-8
Input TIMESTAMP date optionally time 
Output INTEGER amount of days between the timestamp and 1899-12-31
Counting starts at 0.
TestSQL
SELECT 2 AS ISCORRECT, F_DTIME('03.01.1900') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_DTIME(NULL) FROM RDB$DATABASE;
nach oben • go top •
F_ISLEAPYEAR compatibility to FreeUDFLibC
Entrypoint isleapyear compatible with UTF-8
Input TIMESTAMP date optionally time 
Output INTEGER 1 = is leapyear, 0 = is no leapyear
Y2k-compatible (2000 is a leapyear).
TestSQL
SELECT 1 AS ISCORRECT, F_ISLEAPYEAR('22.08.2000 14:38:12') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_ISLEAPYEAR(NULL) FROM RDB$DATABASE;
nach oben • go top •
F_RISLEAPYEAR input/output-compatibility to rFunc (ISLEAPYEAR)
Entrypoint r_isleapyear compatible with UTF-8
Input INTEGER year
Output INTEGER 1 = is leapyear, 0 = is no leapyear
Y2k-compatible (2000 is a leapyear).
TestSQL
SELECT 1 AS ISCORRECT, F_RISLEAPYEAR(2000) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_RISLEAPYEAR(NULL) FROM RDB$DATABASE;
nach oben • go top •
F_ZEITDIFFERENZ compatibility to FreeUDFLib AvERP, GrUDF
Entrypoint zeitdifferenz compatible with UTF-8
Input TIMESTAMP
TIMESTAMP
CSTRING(1)
date optionally time 1
date optionally time 2
type of output
                    t = time between in days
                    h = time between in hours
                    m = time between in minutes
                    s = time between in seconds
                    alle other values return 0
Output DOUBLE time between date 1 and 2 as floatingpoint of the chosen parameter 3
TestSQL
SELECT 1.000 AS ISCORRECT, F_ZEITDIFFERENZ('02.10.2005 15:00:00', '01.10.2005 15:00:00', 't') FROM RDB$DATABASE;
SELECT 1.125 AS ISCORRECT, F_ZEITDIFFERENZ('02.10.2005 18:00:00', '01.10.2005 15:00:00', 't') FROM RDB$DATABASE;
SELECT 26.500 AS ISCORRECT, F_ZEITDIFFERENZ('02.10.2005 18:00:00', '01.10.2005 15:30:00', 'h') FROM RDB$DATABASE;
SELECT 1589.500 AS ISCORRECT, F_ZEITDIFFERENZ('02.10.2005 18:00:00', '01.10.2005 15:30:30', 'm') FROM RDB$DATABASE;
SELECT 95370.000 AS ISCORRECT, F_ZEITDIFFERENZ('02.10.2005 18:00:00', '01.10.2005 15:30:30', 's') FROM RDB$DATABASE;
SELECT 0.000 AS ISCORRECT, F_ZEITDIFFERENZ('02.10.2005 18:00:00', '01.10.2005 15:30:30', 'x') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_ZEITDIFFERENZ(NULL, NULL, NULL) FROM RDB$DATABASE;
nach oben • go top •
F_COUNTWEEKDAYS function from adhoc
Entrypoint countweekdays compatible with UTF-8
Input TIMESTAMP1
TIMESTAMP2
INTEGER
date optionally time 1
date optionally time 2
No. of weekday
Output INTEGER number of choosen weekdays between date 1 and date 2 
Monday = 1, Thuesday = 2, Wednesday = 3, Thursday = 4, Friday = 5, Saturday = 6, Sunday = 7
Counts number of choosen weekdays between date 1 and date 2 
Starting with version adhoc20090128
- and order of param 1 and 2 (timestamp 1 must not be older than timestamp 2)
- for all weekdays index < 1 and > 7 return is always 0

TestSQL

SELECT 4 AS ISCORRECT, F_COUNTWEEKDAYS('04.02.2008', '27.02.2008', 2) FROM RDB$DATABASE;
SELECT 4 AS ISCORRECT, F_COUNTWEEKDAYS('05.02.2008', '26.02.2008', 2) FROM RDB$DATABASE;
SELECT 3 AS ISCORRECT, F_COUNTWEEKDAYS('06.02.2008', '27.02.2008', 2) FROM RDB$DATABASE;
SELECT 1 AS ISCORRECT, F_COUNTWEEKDAYS('12.12.2008', '17.12.2008', 6) FROM RDB$DATABASE;
SELECT 1 AS ISCORRECT, F_COUNTWEEKDAYS('17.12.2008', '12.12.2008', 6) FROM RDB$DATABASE;
SELECT 0 AS ISCORRECT, F_COUNTWEEKDAYS('12.12.2008', '17.12.2008', 9) FROM RDB$DATABASE;
SELECT 0 AS ISCORRECT, F_COUNTWEEKDAYS('12.12.2008', '17.12.2008', -5) FROM RDB$DATABASE;

SELECT NULL AS ISCORRECT, F_COUNTWEEKDAYS(NULL, NULL, NULL) FROM RDB$DATABASE;
nach oben • go top •
Preliminary note to counting the week of the year - calendar week:
The year contains minimum 52 serially weeks (calender weeks). There are different versions to count. The first week of the year is the week
    * which contains the 1st January (USA, Excel-function)
    * the first week which contains minimum 4 days of the new year (DIN 1355 / ISO 8601)
    * the first complet week of the year (seldom)
The international norm ISO 8601 (1973) appoints monday as starting day of the week. Since 1976 monday is the first day of the week in Germany (DIN 1355). In 1978 the UNO decided, that Monday is the first day of the week.
The results of this are the following rules:
    * every Monday and only on Monday a new calendar week starts
    * the first calendar week of the year ist the week which contains minimum 4 days of the new year
The results of these rules are following characteristics:
    * there are no uncomplete calender weeks, without fail every week contains exactly 7 days
    * every year contains 52 or 53 calendar weeks
    * if a year starts or ends with Thursday, the year has 53 calendar weeks
    * 29th, 30th and 31st of December could belong to the first calendar week of the following year
    * 1st, 2nd and 3rd of January could belong to the last calendar week of the previous year
In many places of the world (f.e. North-America, Australia) there is still the tradition of Jewry and Christianity where Sunday ist the first day of the week. In USA and other countries there are the following rules:
    * every Sunday starts an new calendar week
    * the first calendar week of the year starts on 1. January
The result of these rules are following characteristics:
    * the first and the last calendar week of the year must not be complete, they can have less than 7 days
    * every year contains 53 calendar weeks
    * if the 31st of December is Sunday and the 1st of January of the same year was no Sunday, so this Sunday is the only day in the 54 calendar week. (This constellation happens very seldom, last in 2000, next in 2028).
Unfortunately Gregory Deatz had not read the rules exactly, so some functions are not standard of USA neather ISO (counts with week starting with Sunday). This is for functions F_YEAROFYEAR, F_WEEKOFYEAR and F_WOY. Please do not use this functions.
Functions F_YEAR and F_WEEK are USA standard, functions F_KALENDERWOCHE and F_WOYISO are standard ISO.
from ersetzbar durch EXTRACT(YEAR FROM ...)
F_YEAR
compatibility to FreeUDFLib, FreeUDFLibC, FreeUDFLib AvERP, GrUDF
input/output-compatibility to rFunc (EXTRACTYEAR)
Entrypoint year compatible with UTF-8
F_YEAROFYEAR (don't use) compatibility to FreeUDFLibC
Entrypoint yearofyear compatible with UTF-8
Input TIMESTAMP date optionally time 
Output INTEGER year of the timestamp
F_YEAR counts with USA-Norm: week starting with Sunday, week 1 contains 1st January.
F_YEAROFYEAR counts wrong (not ISO): week starting with Sunday, week 1 starts with Sunday to Wednesday
TestSQL
SELECT 2004 AS ISCORRECT, F_YEAR(' 22.08.2004 14:38:12') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_YEAR(NULL) FROM RDB$DATABASE;
SELECT 2004 AS ISCORRECT, F_YEAROFYEAR(' 22.08.2004 14:38:12') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_YEAROFYEAR(NULL) FROM RDB$DATABASE;
nach oben • go top •
F_QUARTER compatibility to FreeUDFLib, FreeUDFLibC, FreeUDFLib AvERP, GrUDF
input/output-compatibility to rFunc (QUARTER)
Entrypoint quarter compatible with UTF-8
Input TIMESTAMP date optionally time 
Output INTEGER quarter of the timestamp
TestSQL
SELECT 3 AS ISCORRECT, F_QUARTER('23.08.2004 14:38:12') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_QUARTER(NULL) FROM RDB$DATABASE;
nach oben • go top •
from ersetzbar durch EXTRACT(MONTH FROM ...)
F_MONTH compatibility to FreeUDFLib, FreeUDFLibC, FreeUDFLib AvERP, GrUDF
input/output-compatibility to rFunc (EXTRACTMONTH)
Entrypoint month compatible with UTF-8
Input TIMESTAMP date optionally time 
Output INTEGER month of the timestamp
TestSQL
SELECT 8 AS ISCORRECT, F_MONTH('23.08.2004 14:38:12') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_MONTH(NULL) FROM RDB$DATABASE;
nach oben • go top •
F_WEEK
compatibility to FreeUDFLib, FreeUDFLibC, FreeUDFLib AvERP, GrUDF
Entrypoint week compatible with UTF-8
F_WEEKOFYEAR (don't use) compatibility to FreeUDFLibC
Entrypoint weekofyear compatible with UTF-8
Input TIMESTAMP date optionally time 
Output INTEGER the week of the timestamp
Counting like used in USA: Counting starts at week 1 which contains the 1st January.
TestSQL
SELECT 52 AS ISCORRECT, F_WEEK('28.12.2003') FROM RDB$DATABASE;
SELECT 52 AS ISCORRECT, F_WEEK('29.12.2003') FROM RDB$DATABASE;
SELECT 1 AS ISCORRECT, F_WEEK('01.01.2005') FROM RDB$DATABASE;
SELECT 41 AS ISCORRECT, F_WEEK('02.10.2005 14:38:12') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_WEEK(NULL) FROM RDB$DATABASE;
SELECT 34 AS ISCORRECT, F_WEEKOFYEAR('22.08.2004 14:38:12') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_WEEKOFYEAR(NULL) FROM RDB$DATABASE;
nach oben • go top •
F_WOY (don't use) compatibility to FreeUDFLib, FreeUDFLibC, FreeUDFLib AvERP
Entrypoint woy compatible with UTF-8
Input TIMESTAMP date optionally time 
Output CSTRING(6) year and week as string
Counts like Gregory Deatz the year and week of year (week starting with Sunday - see above).
TestSQL
SELECT '200434' AS ISCORRECT, F_WOY('22.08.2004 14:38:12') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_WOY(NULL) FROM RDB$DATABASE;
nach oben • go top •
F_WOYISO function from adhoc
Entrypoint woyiso compatible with UTF-8
Input TIMESTAMP date optionally time
Ouput CSTRING(6) 4 digits year and 2 digits week of year as a string
Counts like ISO the year and week of year. If 1st January is in week 52, 53 or 54 of the previous year, the output year is also the previous year.
SELECT '200453' AS ISCORRECT, F_WOYISO('01.01.2005') FROM RDB$DATABASE;
SELECT '200539' AS ISCORRECT, F_WOYISO('02.10.2005 14:38:12') FROM RDB$DATABASE;
SELECT F_WOYISO('22.08.2009 14:38:12'), F_WOY('22.08.2009 14:38:12') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_WOYISO(NULL) FROM RDB$DATABASE;
nach oben • go top •
F_KALENDERWOCHE function from adhoc
Entrypoint week compatible with UTF-8
Input TIMESTAMP date optionally time 
Output INTEGER the week of the timestamp based on ISO 8601
Counting based on ISO 8601: The counting starts in the week, which contains minimum 4 days of the new year.
TestSQL
SELECT 53 AS ISCORRECT, F_KALENDERWOCHE('31.12.1992') FROM RDB$DATABASE;
SELECT 53 AS ISCORRECT, F_KALENDERWOCHE('31.12.1998') FROM RDB$DATABASE;
SELECT 52 AS ISCORRECT, F_KALENDERWOCHE('28.12.2003') FROM RDB$DATABASE;
SELECT 1 AS ISCORRECT, F_KALENDERWOCHE('29.12.2003') FROM RDB$DATABASE;
SELECT 53 AS ISCORRECT, F_KALENDERWOCHE('31.12.2004') FROM RDB$DATABASE;
SELECT 53 AS ISCORRECT, F_KALENDERWOCHE('01.01.2005') FROM RDB$DATABASE;
SELECT 39 AS ISCORRECT, F_KALENDERWOCHE('02.10.2005') FROM RDB$DATABASE;
SELECT 53 AS ISCORRECT, F_KALENDERWOCHE('31.12.2009') FROM RDB$DATABASE;
SELECT 53 AS ISCORRECT, F_KALENDERWOCHE('31.12.2015') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_KALENDERWOCHE(NULL) FROM RDB$DATABASE;
nach oben • go top •
from ersetzbar durch EXTRACT(HOUR FROM ...)
F_HOUR compatibility to FreeUDFLibC, GrUDF
input/output-compatibility to rFunc (EXTRACTHOUR)
Entrypoint hour compatible with UTF-8
Input TIMESTAMP date optionally time 
Output INTEGER hours of the timestamp
If you entered only date, the hour is = 0.
TestSQL
SELECT 14 AS ISCORRECT, F_HOUR('23.08.2004 14:38:12') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_HOUR(NULL) FROM RDB$DATABASE;
nach oben • go top •
from ersetzbar durch EXTRACT(MINUTE FROM ...)
F_MINUTE compatibility to FreeUDFLibC, GrUDF
input/output-compatibility to rFunc (EXTRACTMINUTE)
Entrypoint minute compatible with UTF-8
Input TIMESTAMP date optionally time 
Output INTEGER minutes of the timestamp
If you entered only date, the minute is = 0.
TestSQL
SELECT 38 AS ISCORRECT, F_MINUTE('23.08.2004 14:38:12') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_MINUTE(NULL) FROM RDB$DATABASE;
nach oben • go top •
from ersetzbar durch EXTRACT(SECOND FROM ...)
F_SECOND compatibility to FreeUDFLibC, GrUDF
input/output-compatibility to rFunc (EXTRACTSECOND)
Entrypoint second compatible with UTF-8
Input TIMESTAMP date optionally time 
Output INTEGER seconds of the timestamp
If you entered only date, the second is = 0.
TestSQL
SELECT 12 AS ISCORRECT, F_SECOND('23.08.2004 14:38:12') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_SECOND(NULL) FROM RDB$DATABASE;
nach oben • go top •
F_MILLISECOND input/output-compatibility to rFunc (EXTRACTMILLISECOND)
Entrypoint millisecond compatible with UTF-8
Input TIMESTAMP date optionally time 
Output INTEGER milliseconds of the timestamp
If you entered only date, the second is = 0.
TestSQL
SELECT 3456 AS ISCORRECT, F_MILLISECOND('23.08.2004 14:38:12 3456') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_MILLISECOND(NULL) FROM RDB$DATABASE;
nach oben • go top •
F_TZVALUETOUTC
function from adhoc
Entrypoint tzvalue_to_utc compatible with UTF-8
Input none
Output DOUBLE Diff of local datetime to UTC (universal time code) in hours
TestSQL
SELECT CAST(DATEDIFF(MINUTE, CURRENT_TIMESTAMP, F_LOCAL2UTC(CURRENT_TIMESTAMP)) / 60 AS DOUBLE PRECISION) AS ISCORRECT, F_TZVALUETOUTC() FROM RDB$DATABASE
nach oben • go top •
 
Date-time functions: Format
F_CMONTHLONG compatibility to FreeUDFLib, FreeUDFLibC, FreeUDFLib AvERP, GrUDF
Entrypoint cmonthlong compatible with UTF-8
Input TIMESTAMP date optionally time 
Output CSTRING(16) month in english
TestSQL
SELECT 'August' AS ISCORRECT, F_CMONTHLONG('23.08.2004') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_CMONTHLONG(NULL) FROM RDB$DATABASE;
nach oben • go top •
U_MONTHLONG function from adhoc
Entrypoint u_monthlong compatible with UTF-8
Input TIMESTAMP date optionally time 
Output CSTRING(20) month in language of OS
TestSQL
SELECT 'deutsch: Januar' AS ISCORRECT, U_MONTHLONG('01.01.2010') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, U_MONTHLONG(NULL) FROM RDB$DATABASE;
nach oben • go top •
F_CMONTHLONGLANG function from adhoc
Entrypoint cmonthlonglang not compatible with UTF-8 - use U_MONTHLONGLANG
Input TIMESTAMP
CSTRING(2)
date optionally time 
language identifier for the output
Output CSTRING(16) month in chosen language
Language version of  F_CMONTHLONG.
Language identifier: de = German, uk = English, fr = French, es = Spanish, it =Italian, es = Spanish, pt = Portuguese,
nl = Dutch, no = Norwegian, Bokmål, se = Swedish, dk = Danish, fi = Finnish, hu = Hungarian, ie = Irish(Gaelic),
ee = Estonian, is = Icelandic, al = Albanian, va = Classical Latin, v1 = Ecclesiastical Latin, c1 = Catalan, s1 = Scots,
s2 = Scottish Gaelic, w1 = Welsh, b1 = Breton, b2 = Basque, n1 = Norwegian, Nynorsk, za = Afrikaans, fo = Faroese,
lu = Luxembourgish, w2 = Wallon
TestSQL
SELECT 'Août' AS ISCORRECT, F_CMONTHLONGLANG('23.08.2004', 'fr') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_CMONTHLONGLANG(NULL, NULL) FROM RDB$DATABASE;
nach oben • go top •
U_MONTHLONGLANG function from adhoc
Entrypoint u_monthlonglang compatible with UTF-8
Input TIMESTAMP
CSTRING(2)
date optionally time 
language identifier for the output
Output CSTRING(16) month in chosen language
Language version of  U_MONTHLONG.
Language identifier: every legal 2-digit identifier closed by the top-level-domains, e.g. de for german
TestSQL
SELECT 'Août' AS ISCORRECT, U_MONTHLONGLANG('23.08.2004', 'fr') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, U_MONTHLONGLANG(NULL, NULL) FROM RDB$DATABASE;
nach oben • go top •
F_CMONTHSHORT compatibility to FreeUDFLibC
Entrypoint cmonthshort compatible with UTF-8
Input TIMESTAMP date optionally time 
Output CSTRING(4) shortcut month in english
TestSQL
SELECT 'Aug' AS ISCORRECT, F_CMONTHSHORT('23.08.2004') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_CMONTHSHORT(NULL) FROM RDB$DATABASE;
nach oben • go top •
U_MONTHSHORT compatibility to FreeUDFLib, FreeUDFLib AvERP, GrUDF
Entrypoint u_monthshort compatible with UTF-8
Input TIMESTAMP date optionally time 
Output CSTRING(4) shortcut month in language of OS
TestSQL
SELECT 'deutsch: Jan' AS ISCORRECT, U_MONTHSHORT('01.01.2010') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, U_MONTHSHORT(NULL) FROM RDB$DATABASE;
nach oben • go top •
F_CMONTHSHORTLANG function from adhoc
Entrypoint cmonthshortlang not compatible with UTF-8 - use U_MONTHSHORTLANG
Input TIMESTAMP
CSTRING(2)
date optionally time 
language identifier for the output
Output CSTRING(4) shortcut month in chosen language
Language version of  F_CMONTHSHORT.
Language identifier: de = German, uk = English, fr = French, es = Spanish, it =Italian, es = Spanish, pt = Portuguese,
nl = Dutch, no = Norwegian, Bokmål, se = Swedish, dk = Danish, fi = Finnish, hu = Hungarian, ie = Irish(Gaelic),
ee = Estonian, is = Icelandic, al = Albanian, va = Classical Latin, v1 = Ecclesiastical Latin, c1 = Catalan, s1 = Scots,
s2 = Scottish Gaelic, w1 = Welsh, b1 = Breton, b2 = Basque, n1 = Norwegian, Nynorsk, za = Afrikaans, fo = Faroese,
lu = Luxembourgish, w2 = Wallon
TestSQL
SELECT 'Aoû' AS ISCORRECT, F_CMONTHSHORTLANG('23.08.2004', 'fr') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_CMONTHSHORTLANG(NULL, NULL) FROM RDB$DATABASE;
nach oben • go top •
U_MONTHSHORTLANG function from adhoc
Entrypoint u_monthshortlang compatible with UTF-8
Input TIMESTAMP
CSTRING(2)
date optionally time 
language identifier for the output
Output CSTRING(4) shortcut month in chosen language
Language version of  U_MONTHSHORT.
Language identifier: every legal 2-digit identifier closed by the top-level-domains, e.g. de for german
TestSQL
SELECT 'Aoû' AS ISCORRECT, U_MONTHSHORTLANG('23.08.2004', 'fr') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, U_MONTHSHORTLANG(NULL, NULL) FROM RDB$DATABASE;
nach oben • go top •
F_CDOWLONG compatibility to FreeUDFLibC
Entrypoint cdowlong compatible with UTF-8
Input TIMESTAMP date optionally time 
Output CSTRING(16) day of the week in english
TestSQL
SELECT 'Monday' AS ISCORRECT, F_CDOWLONG('23.08.2004') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_CDOWLONG(NULL) FROM RDB$DATABASE;
nach oben • go top •
U_DOWLONG compatibility to FreeUDFLib, FreeUDFLib AvERP, GrUDF
Entrypoint u_dowlong compatible with UTF-8
Input TIMESTAMP date optionally time 
Output CSTRING(16) day of the week in language of OS
TestSQL
SELECT 'deutsch: Donnerstag' AS ISCORRECT, U_DOWLONG('11.11.2010') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, U_DOWLONG(NULL) FROM RDB$DATABASE;
nach oben • go top •
F_CDOWLONGLANG function from adhoc
Entrypoint cdowlonglang not compatible with UTF-8 - use U_DOWLONGLANG
Input TIMESTAMP
CSTRING(2)
date optionally time
language identifier for the output
Output CSTRING(16) day of the week in chosen language
Language version of  F_CDOWLONG.
Language identifier: de = German, uk = English, fr = French, es = Spanish, it =Italian, es = Spanish, pt = Portuguese,
nl = Dutch, no = Norwegian, Bokmål, se = Swedish, dk = Danish, fi = Finnish, hu = Hungarian, ie = Irish(Gaelic),
ee = Estonian, is = Icelandic, al = Albanian, va = Classical Latin, v1 = Ecclesiastical Latin, c1 = Catalan, s1 = Scots,
s2 = Scottish Gaelic, w1 = Welsh, b1 = Breton, b2 = Basque, n1 = Norwegian, Nynorsk, za = Afrikaans, fo = Faroese,
lu = Luxembourgish, w2 = Wallon
TestSQL
SELECT 'Lundi' AS ISCORRECT, F_CDOWLONGLANG('23.08.2004', 'fr') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_CDOWLONGLANG(NULL, NULL) FROM RDB$DATABASE;
nach oben • go top •
U_DOWLONGLANG function from adhoc
Entrypoint u_dowlonglang compatible with UTF-8
Input TIMESTAMP
CSTRING(2)
date optionally time
language identifier for the output
Output CSTRING(16) day of the week in chosen language
Language version of  U_DOWLONG.
Language identifier: every legal 2-digit identifier closed by the top-level-domains, e.g. de for german
TestSQL
SELECT 'Lundi' AS ISCORRECT, U_DOWLONGLANG('23.08.2004', 'fr') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, U_DOWLONGLANG(NULL, NULL) FROM RDB$DATABASE;
nach oben • go top •
F_CDOWSHORT compatibility to FreeUDFLibC
Entrypoint cdowshort compatible with UTF-8
Input TIMESTAMP date optionally time 
Output CSTRING(4) shortcut day of week in english
TestSQL
SELECT 'Mon' AS ISCORRECT, F_CDOWSHORT('23.08.2004') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_CDOWSHORT(NULL) FROM RDB$DATABASE;
nach oben • go top •
U_DOWSHORT compatibility to FreeUDFLib, FreeUDFLib AvERP, GrUDF
Entrypoint u_dowshort compatible with UTF-8
Input TIMESTAMP date optionally time 
Output CSTRING(4) shortcut day of week in language of OS
TestSQL
SELECT 'deutsch: Do.' AS ISCORRECT, U_DOWSHORT('11.11.2010') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, U_DOWSHORT(NULL) FROM RDB$DATABASE;
nach oben • go top •
F_CDOWSHORTLANG function from adhoc
Entrypoint cdowshortlang not compatible with UTF-8 - use U_DOWSHORTLANG
Input TIMESTAMP
CSTRING(2)
date optionally time 
language identifier for the output
Output CSTRING(16) shortcut day of the week in chosen language
Language version of  F_CDOWSHORT.
Language identifier: de = German, uk = English, fr = French, es = Spanish, it =Italian, es = Spanish, pt = Portuguese,
nl = Dutch, no = Norwegian, Bokmål, se = Swedish, dk = Danish, fi = Finnish, hu = Hungarian, ie = Irish(Gaelic),
ee = Estonian, is = Icelandic, al = Albanian, va = Classical Latin, v1 = Ecclesiastical Latin, c1 = Catalan, s1 = Scots,
s2 = Scottish Gaelic, w1 = Welsh, b1 = Breton, b2 = Basque, n1 = Norwegian, Nynorsk, za = Afrikaans, fo = Faroese,
lu = Luxembourgish, w2 = Wallon
TestSQL
SELECT 'Lun' AS ISCORRECT, F_CDOWSHORTLANG('23.08.2004', 'fr') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_CDOWSHORTLANG(NULL, NULL) FROM RDB$DATABASE;
nach oben • go top •
U_DOWSHORTLANG function from adhoc
Entrypoint u_dowshortlang compatible with UTF-8
Input TIMESTAMP
CSTRING(2)
date optionally time 
language identifier for the output
Output CSTRING(16) shortcut day of the week in chosen language
Language version of  F_CDOWSHORT.
Language identifier:  every legal 2-digit identifier closed by the top-level-domains, e.g. de for german
TestSQL
SELECT 'Lun' AS ISCORRECT, U_DOWSHORTLANG('23.08.2004', 'fr') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, U_DOWSHORTLANG(NULL, NULL) FROM RDB$DATABASE;
nach oben • go top •
F_GFORMATD function from adhoc
Entrypoint gformatd compatible with UTF-8
Input CSTRING(254)
TIMESTAMP
pattern of timestamp
date optionally time
Output CSTRING(254) date formated like pattern from parameter 1
Parameter 1
        d      = day possibly one-digit
        dd    = day always in two digits
        m     = month possibly one-digit
        mm  = month always in two-digits
        yy    = year always in two digits
        yyyy = year always in four digits
        h      = hour possibly one-digit
        hh    = hour always in two digits
        n     = minute possibly one-digit
        nn   = minute always in two digits
        s     = second possibly one-digit
        ss    = second always in two digits
        all other indications will indicate according to their task in parameters 1 in the respective place.
TestSQL
SELECT '01-10-2005 15:09:12' AS ISCORRECT, F_GFORMATD('dd-mm-yyyy hh:nn:ss', '01.10.2005 15:09:12') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_GFORMATD(NULL, NULL) FROM RDB$DATABASE;
nach oben • go top •
F_DATETOSTR input/output-compatibility to rFunc (DATETOSTR)
Entrypoint datetostr compatible with UTF-8
Input TIMESTAMP
CSTRING(254)
date optionally time
pattern
Output CSTRING(254) date formated with parameter 2
Pattern for parameter 2 (similar to c-function strftime):
     %% - character %,
     %c - date and time,
     %x - date,
     %d - day of a month (01-31),
     %j - day of year (000-366),
     %w - day of week (0-6), 0 - Sunday,
     %U - number of week in one year (00-53), Sunday - the first day of week,
     %W - number of week in one year (00-53), Monday - the first day of week,
     %a - the short name of day of week,
     %A - the full name of day of week,
     %m - month (01-12),
     %b - the short name of day of month,
     %B - the full name of day of month,
     %y - year (00-99),    %Y - four-digit year,
     %X - time,
     %H - hour (00-23),   %I - hour (01-12),
     %M - minute (00-59),
     %p - AM or PM,
     %S - second (00-59).
TestSQL
SELECT '10 February 2004, 08:23:00' AS ISCORRECT, F_DATETOSTR('10.02.04 08:23', '%d %B %Y, %X') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_DATETOSTR(NULL, NULL) FROM RDB$DATABASE;
nach oben • go top •
F_DATETOSTRLANG function from adhoc
Entrypoint datetostrlang not compatible with UTF-8 - use U_DATE2STRLANG
Input TIMESTAMP
CSTRING(254)
CSTRING(2)
date optionally time
pattern
language identifier for the output
Output CSTRING(254) date formated with parameter 2 in choosen language
Language version of  F_DATETOSTR.
Language identifier: de = German, uk = English, fr = French, es = Spanish, it =Italian, es = Spanish, pt = Portuguese,
nl = Dutch, no = Norwegian, Bokmål, se = Swedish, dk = Danish, fi = Finnish, hu = Hungarian, ie = Irish(Gaelic),
ee = Estonian, is = Icelandic, al = Albanian, va = Classical Latin, v1 = Ecclesiastical Latin, c1 = Catalan, s1 = Scots,
s2 = Scottish Gaelic, w1 = Welsh, b1 = Breton, b2 = Basque, n1 = Norwegian, Nynorsk, za = Afrikaans, fo = Faroese,
lu = Luxembourgish, w2 = Wallon
Pattern for parameter 2 (similar to c-function strftime): sea F_DATETOSTR
TestSQL
SELECT 'Tuesday, 10 February 2004, 08:23:00' AS ISCORRECT, F_DATETOSTRLANG('10.02.04 08:23', '%A, %d %B %Y, %X', 'uk') FROM RDB$DATABASE;
SELECT 'Dienstag, 10 Februar 2004, 08:23:00' AS ISCORRECT, F_DATETOSTRLANG('10.02.04 08:23', '%A, %d %B %Y, %X', 'de') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_DATETOSTRLANG(NULL, NULL, NULL) FROM RDB$DATABASE;
nach oben • go top •
U_DATE2STRLANG function from adhoc
Entrypoint u_date2strlang compatible with UTF-8
Input TIMESTAMP
CSTRING(254)
CSTRING(2)
date optionally time
pattern
language identifier for the output
Output CSTRING(254) date formated with parameter 2 in choosen language
multifunctional configurable version of F_DATETOSTR
Pattern for Parameter 2 in icu-Standard:
Symbol Meaning Example
G era designator G AD
y year yy
yyyy or y
96
1996
Y year of "Week of Year" Y 1997
u extended year u 4601
Q quarter Q or QQ
QQQ
QQQQ
02
Q2
2nd quarter
q Stand Alone quarter q or qq
qqq
qqqq
02
Q2
2nd quarter
M month in year M or MM
MMM
MMMM
MMMMM
09
Sept
September
S
L Stand Alone month in year L or LL
LLL
LLLL
LLLLL
09
Sept
September
S
w week of year w or ww 27
W week of month W 2
d day in month d
dd
2
02
D day of year D 189
F day of week in month
2 (2nd Wed in July)
g modified julian day g 2451334
E day of week E, EE, or EEE
EEEE
EEEEE
Tues
Tuesday
T
e local day of week
example: if Monday is 1st day, Tuesday is 2nd )
e or ee
eee
eeee
eeeee
2
Tues
Tuesday
T
c Stand Alone local day of week e or ee
eee
eeee
eeeee
2
Tues
Tuesday
T
a am/pm marker a pm
h hour in am/pm (1~12) h
hh
7
07
H hour in day (0~23) H
HH
0
00
k hour in day (1~24) k
kk
24
24
K hour in am/pm (0~11) K
KK
0
00
m minute in hour m
mm
4
04
s second in minute s
ss
5
05
S millisecond
rounds to count of letters)
S
SS
SSS
SSSS
2
24
235
2350
A milliseconds in day A 61201235
z Time Zone: specific non-location z, zz, or zzz
zzzz
PDT
Pacific Daylight Time
Z Time Zone: RFC 822
Time Zone: localized GMT
Z, ZZ, or ZZZ
ZZZZ
-0800
GMT-08:00
v Time Zone: generic non-location v
vvvv
PT
Pacific Time or United States (Los Angeles)
V Time Zone: generic non-location V PT
VVVV Time Zone: generic location VVVV United States (Los Angeles)
W week in month
2
' escape for text ' (nothing)
' ' two single quotes produce one ' ' '
Examples
Format Pattern Result
yyyy.MM.dd G 'at' HH:mm:ss zzz 1996.07.10 AD at 15:08:56 PDT
EEE, MMM d, ''yy Wed, July 10, '96
h:mm a 12:08 PM
hh 'o''clock' a, zzzz 12 o'clock PM, Pacific Daylight Time
K:mm a, z 0:00 PM, PST
yyyyy.MMMM.dd GGG hh:mm aaa 01996.July.10 AD 12:08 PM
Sprachkennzeichen:  every legal 2-digit identifier closed by the top-level-domains, e.g. de for german
TestSQL
SELECT 'Tuesday, 10 February ' || F_SQM() || '04 at 2 o' || F_SQM() || 'clock and 23 minutes 17 seconds PM' AS ISCORRECT, U_DATE2STRLANG('10.02.04 14:23:17', 'EEEE, dd MMMM ' || F_DSQM() || 'yy ' || F_SQM() || 'at' || F_SQM() || ' K ' || F_SQM() || 'o' || F_DSQM() || 'clock and ' || F_SQM() || 'm' || F_SQM() || ' minutes ' || F_SQM() || 's' || F_SQM() || ' seconds ' || F_SQM() || 'a', 'en') FROM RDB$DATABASE;

SELECT 'mardi, 10 février 2004, 14:23:17' AS ISCORRECT, U_DATE2STRLANG('10.02.04 14:23:17', 'EEEE, dd MMMM yyyy, HH:mm:ss', 'fr') FROM RDB$DATABASE;

SELECT 'Dienstag, 10 Februar 2004, 14:23:17' AS ISCORRECT, U_DATE2STRLANG('10.02.04 14:23:17', 'EEEE, dd MMMM yyyy, HH:mm:ss', 'de') FROM RDB$DATABASE;

SELECT NULL AS ISCORRECT, U_DATE2STRLANG(NULL, NULL, NULL) FROM RDB$DATABASE;
nach oben • go top •
F_ENCODEDATE compatibility to GrUDF
Entrypoint encodedate compatible with UTF-8
F_ENCODEDATENULL function from adhoc
Entrypoint encodedatenull compatible with UTF-8
Input INTEGER
INTEGER
INTEGER
year
month
day
Output DATE date built from parameters
F_ENCODEDATENULL is able to return NULL
TestSQL
SELECT '20.02.2004' AS ISCORRECT, F_ENCODEDATE(2004, 2, 20) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_ENCODEDATENULL(NULL, NULL, NULL) FROM RDB$DATABASE;
nach oben • go top •
F_RENCODEDATE input/output-compatibility to rFunc (ENCODEDATE)
Entrypoint r_encodedate compatible with UTF-8
Input INTEGER
INTEGER
INTEGER
day
month
year
Output DATE date build from parameters
Input-parameter in other order than F_ENCODEDATE
TestSQL
SELECT '20.02.2004' AS ISCORRECT, F_RENCODEDATE(20, 2, 2004) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_RENCODEDATE(NULL, NULL, NULL) FROM RDB$DATABASE;
nach oben • go top •
F_ENCODETIME compatibility to zu GrUDF
Entrypoint encodetime compatible with UTF-8
F_ENCODETIMENULL function from adhoc
Entrypoint encodetimenull compatible with UTF-8
Input INTEGER
INTEGER
INTEGER
hours
minutes
seconds
Output TIME time build from parameters
F_ENCODETIMENULL is able to return NULL
TestSQL
SELECT '09:45:53' AS ISCORRECT, F_ENCODETIME(9, 45, 53) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_ENCODETIMENULL(NULL, NULL, NULL) FROM RDB$DATABASE;
nach oben • go top •
F_ENCODETIMESTAMP compatibility to GrUDF
Entrypoint encodetimestamp compatible with UTF-8
Input INTEGER
INTEGER
INTEGER
INTEGER
INTEGER
INTEGER
year
month
day
hours
minutes
seconds
Output TIMESTAMP timestamp build from parameters
TestSQL
SELECT '20.02.2004 09:45:53' AS ISCORRECT, F_ENCODETIMESTAMP(2004, 2, 20, 9, 45, 53) FROM RDB$DATABASE;
SELECT '20.02.2004 00:00:00' AS ISCORRECT, F_ENCODETIMESTAMP(2004, 2, 20, 0, 0, 0) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_ENCODETIMESTAMP(NULL, NULL, NULL, NULL, NULL, NULL) FROM RDB$DATABASE;
nach oben • go top •
F_RENCODEDATETIME input/output-compatibility to rFunc (ENCODEDATETIME)
Entrypoint r_encodedatetime compatible with UTF-8
Input INTEGER
INTEGER
INTEGER
INTEGER
INTEGER
INTEGER
day
month
year
hours
minutes
seconds
Output TIMESTAMP timestamp build from parameters
Input-parameter in other order than F_ENCODETIMESTAMP
TestSQL
SELECT '20.02.2004 09:45:53' AS ISCORRECT, F_RENCODEDATETIME(20, 2, 2004, 9, 45, 53) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_RENCODEDATETIME(NULL, NULL, NULL, NULL, NULL, NULL)) FROM RDB$DATABASE;
nach oben • go top •
F_STRIPDATE compatibility to FreeUDFLib, FreeUDFLibC, FreeUDFLib AvERP
input/output-compatibility to rFunc (EXTRACTTIME)
Entrypoint stripdate compatible with UTF-8
Input TIMESTAMP date optionally time
Output TIMESTAMP timestamp with date 31.12.1899 (date 0) with chosen time
To get only the time use CAST(' 01.10.2005 15:00:00' AS TIME)
TestSQL
SELECT '31.12.1899 15:00:00' AS ISCORRECT, F_STRIPDATE(' 01.10.2005 15:00:00')
FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_STRIPDATE(NULL) FROM RDB$DATABASE;
nach oben • go top •
F_STRIPTIME compatibility to FreeUDFLib, FreeUDFLibC, FreeUDFLib AvERP
input/output-compatibility to rFunc (EXTRACTDATE)
Entrypoint striptime compatible with UTF-8
Input TIMESTAMP date optionally time
Output TIMESTAMP timestamp with time 00:00:00 from chosen date
To get only the date use CAST(‘01.10.2005 15:00:00' AS DATE)
TestSQL
SELECT '01.10.2005 00:00:00' AS ISCORRECT, F_STRIPTIME(' 01.10.2005 15:00:00')
FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_STRIPTIME(NULL) FROM RDB$DATABASE;
nach oben • go top •
 
Date-time functionsCompare
F_MAXDATE compatibility to FreeUDFLib, FreeUDFLibC, FreeUDFLib AvERP
input/output-compatibility to rFunc (MAXDATE)
Entrypoint maxdate compatible with UTF-8
Input TIMESTAMP
TIMESTAMP
date optionally time 1
date optionally time 2
Output TIMESTAMP the newer date
TestSQL
SELECT '01.10.2005 15:00:00' AS ISCORRECT, F_MAXDATE('22.08.2000 14:38:12', '01.10.2005 15:00:00') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_MAXDATE(NULL, NULL) FROM RDB$DATABASE;
nach oben • go top •
F_MINDATE compatibility to FreeUDFLib, FreeUDFLibC, FreeUDFLib AvERP
input/output-compatibility to rFunc (MINDATE)
Entrypoint mindate compatible with UTF-8
Input TIMESTAMP
TIMESTAMP
date optionally time 1
date optionally time 2
Output TIMESTAMP the older date
TestSQL
SELECT '22.08.2000 14:38:12' AS ISCORRECT, F_MINDATE('22.08.2000 14:38:12', '01.10.2005 15:00:00') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_MINDATE(NULL, NULL) FROM RDB$DATABASE;
nach oben • go top •
F_EQUALDATE compatibility to zu FreeUDFLib AvERP, GrUDF
Entrypoint equaldate compatible with UTF-8
Input TIMESTAMP
TIMESTAMP
date optionally time 1
date optionally time 2
Output INTEGER 1 = date is equal, 0 = date is not equal
Tested only on date (time could be entered but never used)
TestSQL
SELECT 1 AS ISCORRECT, F_EQUALDATE('20.02.2004 10:00:00', '20.02.2004 11:00:00') FROM RDB$DATABASE;
SELECT 0 AS ISCORRECT, F_EQUALDATE('20.02.2004 10:00:00', '21.02.2004 11:00:00') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_EQUALDATE(NULL, NULL) FROM RDB$DATABASE;
nach oben • go top •
F_EQUALDATETIME compatibility to FreeUDFLib AvERP, GrUDF
input/output-compatibility to rFunc (DTEQUAL)
Entrypoint equaldatetime compatible with UTF-8
Input TIMESTAMP
TIMESTAMP
date optionally time 1
date optionally time 2
Output INTEGER 1 =timestamp is equal, 0 = timestamp is not equal
Testet on date and time
TestSQL
SELECT 1 AS ISCORRECT, F_EQUALDATETIME('20.02.2004 10:00:00', '20.02.2004 10:00:00') FROM RDB$DATABASE;
SELECT 0 AS ISCORRECT, F_EQUALDATETIME('20.02.2004 10:00:00', '20.02.2004 11:00:00') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_EQUALDATETIME(NULL, NULL) FROM RDB$DATABASE;
nach oben • go top •
 
Date-time functionsConvert
F_STRTOTIME compatibility to FreeUDFLibC
Entrypoint strtotime compatible with UTF-8
Input CSTRING(11) british/american time (f.e. 05:04:01 AM) as string
Output TIME time in format 24 hours
Inputformat could be with one or two digits and the separation from AM/PM with or without blanks, AM/PM must be entered in capital letters.
TestSQL   
SELECT '05:04:01' AS ISCORRECT, F_STRTOTIME('05:04:01 AM') FROM RDB$DATABASE;
SELECT '17:04:01' AS ISCORRECT, F_STRTOTIME('5:4:1PM') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_STRTOTIME(NULL) FROM RDB$DATABASE;
nach oben • go top •
F_DATETODOUBLE input/output-compatibility to rFunc (DATETODOUBLE)
Entrypoint datetodouble compatible with UTF-8
Input TIMESTAMP date optionally time
Output DOUBLE timestamp as  floatingpoint (infront of dot date, after dot time; 1.0 = 24 h)
TestSQL
SELECT 54205.59375 AS ISCORRECT, F_DATETODOUBLE('15.04.2007 14:15:00') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_DATETODOUBLE(NULL) FROM RDB$DATABASE;
nach oben • go top •
F_TIMETODOUBLE input/output-compatibility to rFunc (TIMETODOUBLE)
Entrypoint timetodouble compatible with UTF-8
Input TIMESTAMP date optionally time
Output DOUBLE timestamp as  floatingpoint (infront of dot 0, after dot time; 1.0 = 24 h)
TestSQL
SELECT 0.59375 AS ISCORRECT, F_TIMETODOUBLE('15.04.2007 14:15:00') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_TIMETODOUBLE(NULL) FROM RDB$DATABASE;
nach oben • go top •
F_DOUBLETODATE input/output-compatibility to rFunc (DOUBLETODATE)
Entrypoint doubletodate compatible with UTF-8
Input DOUBLE timestamp as  floatingpoint (infront of dot date, after dot time; 1.0 = 24 h)
Output TIMESTAMP timestamp
rFunc uses modified julian calendar (0 = 17.11.1858 00:00:00) Because of this with date 0 returns 31.12.1899 instead of 17.11.1858.
TestSQL
SELECT '15.04.2007 14:15:00' AS ISCORRECT, F_DOUBLETODATE(54205.59375) FROM RDB$DATABASE;
SELECT NULL' AS ISCORRECT, F_DOUBLETODATE(NULL) FROM RDB$DATABASE;
nach oben • go top •
F_DOUBLETOTIME input/output-compatibility to rFunc (DOUBLETOTIME)
Entrypoint doubletotime compatible with UTF-8
Input DOUBLE timestamp as  floatingpoint (infront of dot date, after dot time; 1.0 = 24 h)
Output TIMESTAMP timestamp
Uses from input only digits after dot (the time-part).
rFunc uses modified julian calendar (0 = 17.11.1858 00:00:00) Because of this with date 0 returns 31.12.1899 instead of 17.11.1858.
TestSQL
SELECT '31.12.1899 14:15:00' AS ISCORRECT, F_DOUBLETOTIME(0.59375) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_DOUBLETOTIME(NULL) FROM RDB$DATABASE;
nach oben • go top •
F_PERIOD2SECONDS function from adhoc
Entrypoint period2seconds compatible with UTF-8
Input CSTRING(254) period in pattern [d]:h:m:s
Output INTEGER period in seconds
Periods could be enter with 2- or 1digits interval (dd:hh:mm:ss or d:h:m:s).
Negative periods starts with a "-" in front.
Periods with pattern days:hours:minutes:seconds (4 intervalls) or hours:minutes:seconds (3 intervalls) are allowed.
The output of periods with less than 3 intervalls or containing other characters is <null> or empty string.
For input also f.e. '0:26:0:0' instead of '1:2:0:0' alllowed for 26 hours.
TestSQL
SELECT 4205 AS ISCORRECT, F_PERIOD2SECONDS('0:1:10:5') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_PERIOD2SECONDS(NULL) FROM RDB$DATABASE;
nach oben • go top •
F_SECONDS2PERIOD function from adhoc
Entrypoint seconds2period compatible with UTF-8
Input INTEGER seconds of a period
Output CSTRING(254) period in pattern d:h:m:s
The output is allways in pattern days:hours:minutes:seconds (4 * 2 digit intervalls).
Negativ periods starts with "-".
TestSQL
SELECT '00:01:10:05' AS ISCORRECT, F_SECONDS2PERIOD(4205) FROM RDB$DATABASE;
SELECT '-00:01:10:05' AS ISCORRECT, F_SECONDS2PERIOD(-4205) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_SECONDS2PERIOD(NULL) FROM RDB$DATABASE;
nach oben • go top •
 
Date-time functions: movable feasts
F_WEIBERFASTNACHT function from adhoc
Entrypoint weiberfastnacht compatible with UTF-8
Input INTEGER year
Output DATE date of Carnival Dirty Thuresday of the year
TestSQL
SELECT '15.02.2007' AS ISCORRECT, F_WEIBERFASTNACHT(2007) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_WEIBERFASTNACHT(NULL) FROM RDB$DATABASE;
nach oben • go top •
F_ROSENMONTAG function from adhoc
Entrypoint rosenmontag compatible with UTF-8
Input INTEGER year
Output DATE date of Carnival Monday of the year
TestSQL
SELECT '19.02.2007' AS ISCORRECT, F_ROSENMONTAG(2007) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_ROSENMONTA(NULL) FROM RDB$DATABASE;
nach oben • go top •
F_KARNEVALSDIENSTAG function from adhoc
Entrypoint karnevalsdienstag compatible with UTF-8
Input INTEGER year
Output DATE date of Mardi Gras of the year
TestSQL
SELECT '20.02.2007' AS ISCORRECT, F_KARNEVALSDIENSTAG(2007) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_KARNEVALSDIENSTAG(NULL) FROM RDB$DATABASE;
nach oben • go top •
F_ASCHERMITTWOCH function from adhoc
Entrypoint aschermittwoch compatible with UTF-8
Input INTEGER year
Output DATE date of Ash Wednesday of the year
TestSQL
SELECT '21.02.2007' AS ISCORRECT, F_ASCHERMITTWOCH(2007) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_ASCHERMITTWOCH(NULL) FROM RDB$DATABASE;
nach oben • go top •
F_PALMSONNTAG function from adhoc
Entrypoint palmsonntag compatible with UTF-8
Input INTEGER year
Output DATE date of Palm Sunday of the year
TestSQL
SELECT '01.04.2007' AS ISCORRECT, F_PALMSONNTAG(2007) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_PALMSONNTAG(NULL) FROM RDB$DATABASE;
nach oben • go top •
F_GRUENDONNERSTAG function from adhoc
Entrypoint gruendonnerstag compatible with UTF-8
Input INTEGER year
Output DATE date of Holy Thursday of the year
TestSQL
SELECT '05.04.2007' AS ISCORRECT, F_GRUENDONNERSTAG(2007) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_GRUENDONNERSTAG(NULL) FROM RDB$DATABASE;
nach oben • go top •
F_KARFREITAG function from adhoc
Entrypoint karfreitag compatible with UTF-8
Input INTEGER year
Output DATE date of Easter Friday of the year
TestSQL
SELECT '06.04.2007' AS ISCORRECT, F_KARFREITAG(2007) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_KARFREITAG(NULL) FROM RDB$DATABASE;
nach oben • go top •
F_OSTERSAMSTAG function from adhoc
Entrypoint ostersamstag compatible with UTF-8
Input INTEGER year
Output DATE date of Easter Saturday of the year
TestSQL
SELECT '07.04.2007' AS ISCORRECT, F_OSTERSAMSTAG(2007) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_OSTERSAMSTAG(NULL) FROM RDB$DATABASE;
nach oben • go top •
F_OSTERDATUM compatibility to FreeUDFLib AvERP, GrUDF
Entrypoint osterdatum compatible with UTF-8
Input INTEGER year
Output DATE date of Easter Sunday of the year
TestSQL
SELECT '27.03.2005' AS ISCORRECT, F_OSTERDATUM(2005) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_OSTERDATUM(NULL) FROM RDB$DATABASE;
nach oben • go top •
F_OSTERMONTAG function from adhoc
Entrypoint ostermontag compatible with UTF-8
Input INTEGER year
Output DATE date of Easter Monday of the year
TestSQL
SELECT '09.04.2007' AS ISCORRECT, F_OSTERMONTAG(2007) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_OSTERMONTAG(NULL) FROM RDB$DATABASE;
nach oben • go top •
F_HIMMELFAHRT function from adhoc
Entrypoint himmelfahrt compatible with UTF-8
Input INTEGER year
Output DATE date of Ascension of Chris of the year
TestSQL
SELECT '17.05.2007' AS ISCORRECT, F_HIMMELFAHRT(2007) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_HIMMELFAHRT(NULL) FROM RDB$DATABASE;
nach oben • go top •
F_PFINGSTSONNTAG function from adhoc
Entrypoint pfingstsonntag compatible with UTF-8
Input INTEGER year
Output DATE date of Whitsunday of the year
TestSQL
SELECT '27.05.2007' AS ISCORRECT, F_PFINGSTSONNTAG(2007) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_PFINGSTSONNTAG(NULL) FROM RDB$DATABASE;
nach oben • go top •
F_PFINGSTMONTAG function from adhoc
Entrypoint pfingstmontag compatible with UTF-8
Input INTEGER year
Output DATE date of Whitmonday of the year
TestSQL
SELECT '28.05.2007' AS ISCORRECT, F_PFINGSTMONTAG(2007) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_PFINGSTMONTAG(NULL) FROM RDB$DATABASE;
nach oben • go top •
F_FRONLEICHNAM function from adhoc
Entrypoint fronleichnam compatible with UTF-8
Input INTEGER year
Output DATE date of Feast of Corpus Christi of the year
TestSQL
SELECT '07.06.2007' AS ISCORRECT, F_FRONLEICHNAM(2007) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_FRONLEICHNAM(NULL) FROM RDB$DATABASE;
vorige Seite • previous page • passée sitenach oben • go top • vers le hautnächste Seite • next page • prochain site