T-SQL Tutor Project, September 2002

For this homework assignment, try your hand at creating a UDF that returns datetime data in a specified format.

Kimberly L. Tripp

August 31, 2002

1 Min Read
ITPro Today logo in a gray background | ITPro Today

Here's a small homework assignment to help you continue to improve your T-SQL skills. You can find the answer online in the UserDefinedFunctionHomeworkAnswers.sql script file.

Applying the tools and tips I explain in this column, create a function that returns date values in the Mon_dd_yyyy format (e.g., Sep_14_2002 or Jan_01_2000). The number of characters for the month should be three, the separator should be a parameter, which will let you use any character (not just _), and the separator should always return 11 characters aligned properly for easy readability.

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like