• Ok, try changing date to datetime in the function(s). It seems like date as a datatype didn't exist before sql server 2008.

    2005:

    http://msdn.microsoft.com/en-us/library/ms187752%28v=sql.90%29.aspx

    2008:

    http://msdn.microsoft.com/en-us/library/ms187752%28v=sql.100%29.aspx

    Best regards,

    Robin