January 27th, 2012, 10:33 AM
Join Date: Oct 2011
Time spent in forums: 13 h 33 m 11 sec
Reputation Power: 4
I'm building dashboard in php, retrieving data from multiple database types. Right now, my focus is on a Spiceworks SQLITE database.
I'm not familiar with the functions in Sqlite. I'm trying to query the monthly ticket total, group the total by month and store that in an array. I'm not for sure about the SQL syntax to do this.... I could just select * from the table and have the php process the data, but I would rather the data be processes when the query executes. Right now, I'm using something that has DATEPART().
DatePart(mm, created_at) as date
WHERE DateDiff(yyyy, created_at, GetDate()) = 0
Group by DatePart(mm,created_at)
Order by DatePart(mm, created_at)
Could anyone help me out with what syntax that I would need to accomplish this?