Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

mysql first day of month

-- Replace curdate() with your date column
SELECT curdate(), 
	DATE_SUB( curdate(), INTERVAL DAYOFMONTH(curdate())-1 DAY ) AS '1st of month';
Source by www.oreilly.com #
 
PREVIOUS NEXT
Tagged: #mysql #day #month
ADD COMMENT
Topic
Name
1+2 =