Please start any new threads on our new 
    site at https://forums.sqlteam.com.  We've got lots of great SQL Server
    experts to answer whatever question you can come up with.
    
        | 
                
                    | 
                            
                                | Author | Topic |  
                                    | nheijminkStarting Member
 
 
                                        8 Posts | 
                                            
                                            |  Posted - 2008-01-09 : 14:45:54 
 |  
                                            | Hii'am just an beginner with sql  but can sombody tell me how to select a month out of a datetime?tnks  |  |  
                                    | russellPyro-ma-ni-yak
 
 
                                    5072 Posts | 
                                        
                                          |  Posted - 2008-01-09 : 15:29:48 
 |  
                                          | SELECT DatePart(month, YourDateField) FROM YourTable |  
                                          |  |  |  
                                    | nheijminkStarting Member
 
 
                                    8 Posts | 
                                        
                                          |  Posted - 2008-01-09 : 15:37:15 
 |  
                                          | tnks i tought there was also something like datetime.month or month(datetime) this becouse i am using this sql in vba code. |  
                                          |  |  |  
                                    | rmiaoMaster Smack Fu Yak Hacker
 
 
                                    7266 Posts | 
                                        
                                          |  Posted - 2008-01-09 : 23:26:41 
 |  
                                          | There is month() function in t-sql. |  
                                          |  |  |  
                                    | sshelperPosting Yak  Master
 
 
                                    216 Posts | 
                                        
                                          |  Posted - 2008-01-09 : 23:45:33 
 |  
                                          | If you want to get the name of the month instead the month number, you can use the DATENAME function:select datename(mm, getdate())SQL Server Helperhttp://www.sql-server-helper.com |  
                                          |  |  |  
                                |  |  |  |