I have a query like this
SELECT date_format( doj, '%d/%m/%Y' ) AS week ,
WHERE doj between '2012-01-01'
group BY WEEK(doj)
week COUNT(user_id)06/01/2012 317/01/2012 225/01/2012 329/01/2012 1
Jul 23 '12 at 09:08 AM
Jul 23 '12 at 09:19 AM
In mySQL? No idea.
In TSQL - SELECT DATEPART(wk,GETDATE()) returns 31 - ie the 31st week since the start of the calendar year.
Jul 23 '12 at 12:17 PM
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.
Once you sign in you will be able to subscribe for any updates here
Answers and Comments
Need long-form SQL discussion? SQLserverCentral.com is the place.
asked: Jul 23 '12 at 09:08 AM
Seen: 509 times
Last Updated: Jul 23 '12 at 12:17 PM
log shipping with mysql
sql connection from a php page
how to merge the colum from different tables
ER Diagrams (Viso?)
How to create a database with differing form responses
Setting value of a column based on criteria from another
Naming conventions - MySQL
How can I transfer mysql tables to MS-SQL?
When using a static column with SELECT, why can't I access that column from WHERE clause?