MYSQL : QUERY YEARLY SALES COUNT() AND SUM() FUNCTIONS.

SELECT DATE_FORMAT(date, ‘%Y’), COUNT(id) AS `Num_Trans`, SUM(amount) AS `sum` FROM sales_transactions WHERE ?????? = ‘???????????’
GROUP BY DATE_FORMAT(date, ‘%Y’)

SOURCE: http://fabrikar.com/forums/index.php?threads/locked-how-to-generate-daily-monthly-yearly-sales-report.34615/

 

Advertisements
This entry was posted in MYSQL. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s