Count uniques ?

A

Adriano Lul

I need to know how I use the count function to have a sum of days
ie: I have several transactions in several days like hmmm Tasks
Task -> id, price, day , description

so in every day I did some tasks
I sum them with the Task.sum:)price)
but I want to do an automatized way to have an average description (sum
/ days )
how can I do it ?
ps: day is datetime ...
 
R

Roger Pack

You can substract datetimes to get the difference between them in seconds.
Time.now - Time.now
Use that to average?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top