• What I can say? Have you tried to search this site?

    Check it here:

    http://www.sqlservercentral.com/Forums/Topic796803-338-1.aspx#bm796805

    As I said, you don't need to create function for this, especially the one you have which unnecessary converts dates to all other data types...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]