• Welcome to the Chevereto User Community!

    Here, users from all over the world come together to learn, share, and collaborate on everything related to Chevereto. It's a place to exchange ideas, ask questions, and help improve the software.

    Please keep in mind:

    • This community is user-driven. Always be polite and respectful to others.
    • Support development by purchasing a Chevereto license, which also gives you priority support.
    • Go further by joining the Community Subscription for even faster response times and to help sustain this space

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