I want to get first and last dates of current month (Like 30th or 31st).How to get this one by using postgress sql query.
            Asked
            
        
        
            Active
            
        
            Viewed 1.5k times
        
    5
            
            
         
    
    
        Evan Carroll
        
- 78,363
- 46
- 261
- 468
 
    
    
        suresh
        
- 119
- 2
- 3
- 8
- 
                    You should flag this and migrate to [dba.se] – Evan Carroll Apr 14 '17 at 07:38
1 Answers
18
            First day is easy...
SELECT date_trunc('month', CURRENT_DATE);
Last day isn't much more difficult either.
SELECT date_trunc('month', CURRENT_DATE) + interval '1 month - 1 day';
 
    
    
        Evan Carroll
        
- 78,363
- 46
- 261
- 468