Gerrit Mantel
Programs SQL_SCALAR_FUNCTION - fun_date2weekday

Main program

Namefun_date2weekday
Type_descSQL_SCALAR_FUNCTION
CommentSQLServer User-Defined Function

PURPOSE
Return the description of the weekday for a given date.

This function is independant from @@DATEFIRST.

PARAMETERS
@datum_in DATETIME Given date
@taal_in VARCHAR(2) Language ([UK], NL)
@lengte_in INT Length (1-[9])
@lett_in VARCHAR(1) Case ([C]=Capitalized, U=Uppercase, L=Lowercase)
RETURNS VARCHAR(9) Description of the weekday

EXAMPLES
1)
SELECT dbo.fun_date2weekday(getdate(),'NL',2,'U')
MA

2)
SELECT naam, dbo.fun_date2weekday(gebdat,'NL',3,'C'), gebdat from T_PERSOON
Gerrit Maa 15-02-1957
Hans Din 10-10-1958
Bart Woe 11-11-1959

HISTORY
2004-12-07 - Created function
2014-10-21 - Renamed function from fun_dag to fun_date2weekday
2024-02-09 - Changed history table

TAGS
<program>
<description>Return the description of the weekday for a given date</description>
<generic>1</generic>
<author>Gerrit Mantel</author>
<created>2004-12-07</created>
<lastmodified>2024-02-09</lastmodified>
</program>
DescriptionReturn the description of the weekday for a given date
Minversion
Generic1
AuthorGerrit Mantel
Created2004-12-07 00:00:00
Lastmodified2024-02-09 00:00:00
Xp_cmdshell0
Ole_automation0
Subprogram_cnt0
Sourcecode