Table of Contents

    How to Use the MONTH() Function in SQL Server: A Detailed Guide

    How to Use the MONTH() Function in SQL Server: A Detailed Guide

    Syntax:

    
    Month()
    

    Returns the 'Month number of the year' of the given date.

    Code:

    
    Select Month(GETDATE())
    

    Returns the Month number of the year, based on the current system date and time.

    
    Select Month('01/31/2012') 
    

    Output:

    The above code will produce the following result-

    
    1