Thanks for sharing your solution. I see what you are doing. As the query in our application is dynamically created from a set of forms and can be upto 24 months, programming each month didn't ring my bell. I also checked and can still fall back to passing a start and end date into a query to...
The self-join is the path that I needed. You probably noticed that there is another event that can occur.
If a begin and end date don't include the created date, but do have the updated date a record gets generated that is outside of the range. As an example if the requested range is Aug03 -...
I was just trying to mark this for email notification as I am pursuing a similar problem. In my case we are counting the number of new events "created" (which is a datetime field) and then counting the update event, which is another datetime field. The two can have months in between...
vanekl,
Thank you for your responese.
1. The 'group by rid' in the first sql is only there to allow all of the rows to print out. As you have correctly identified a SUM is a grouping/aggregator and that is why it is in the query. If there is no group by the query will fail.
2. I beg to...
Environment is MySQL 3.23.33, PHP Version 4.3.2.
Have included a couple of extra columns here in an attempt to clarify what
I am trying to do. In the table rid is a unique, auto-increment. The fields
date_created and date_updated are datetime format yyyymmdd hh:mm:ss. Passing a begining and...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.