• Welcome to the Chevereto user community!

    Here users from all over the world gather around to learn the latest about Chevereto and contribute with ideas to improve the software.

    Please keep in mind:

    • 😌 This community is user driven. Be polite with other users.
    • 👉 Is required to purchase a Chevereto license to participate in this community (doesn't apply to Pre-sales).
    • 💸 Purchase a Pro Subscription to get access to active software support and faster ticket response times.

SQL: show amount of images by day

Avast

👽 Chevereto Freak
Hey guys,

i just want to look in my database and get displayed how many images were uploaded by day.

My problem is counting the dates...
This is my query, which displays just all dates of images:
Code:
SELECT LEFT(image_date, 10) FROM `chv_images` GROUP BY image_date

I think i should count the result of "LEFT(image_date,10)"...but i don't know how.

Does someone know the solution?

Regards,
Avast
 
Select the images uploaded in the prior 24 hours:
Code:
SELECT * FROM `chv_images` WHERE `image_date` > DATE_SUB(NOW(), INTERVAL 1 DAY);

Select the images that belongs to today:
Code:
SELECT * FROM `chv_images` WHERE DATE(`image_date`) = CURDATE();

Count these results? Sure...
Change SELECT * for SELECT count(*)
 
Thanks, but this isn't exactly what i wanted.

Is there an opportunity to get the amount of images of every day displayed?
So i don't have to tell the query which exact day.
 
Ahh sure, you need to use count group by... well this is the query:
Code:
SELECT COUNT(*), DATE(image_date) FROM chv_images GROUP BY DATE(image_date)
 
Back
Top