LISTING 5: Queries That Test the Scalar UDF SELECT dbo.CustomDateFormat(getdate(), DEFAULT) -- Returns 09:14:2002 SELECT dbo.CustomDateFormat(getdate(), '!') -- Returns 09!14!2002 SELECT dbo.CustomDateFormat(pubdate, DEFAULT) FROM pubs.dbo.titles -- Returns the entire result set in the custom date format