Hi Rob,
1. DAY is a built-in SQL Server function that returns an integer representing the day datepart of the specified date.
So, SELECT DAY(GetDate()) would return 9 for today's date (GetDate() is a function that returns the current date and time)
2. The first three lines aren't required in a procedure you write yourself. However, if you script the procedures using SQL Server, this is what you get. They're basically defaults to ensure the procedure ends up the same as it was in the system when you scripted it. Don't bother typing this in every time you create a procedure.
3. The number 106 is a parameter to the CONVERT function that tells SQL Server to convert the date and time in a dd mon yyyy format.
Take a look at SQL Server's Books Online for more information about 1 and 3. For 1, the keyword is DAY, for 3 the keyword is CONVERT (and CAST) and you'll find a list with all other possible numbers you can pass to Convert.
Hope this helps,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of
ASP.NET 2.0 Instant Results and
Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out
this post.