Get value of related field using MAX value with annotate.

2015-11-24 Thread Grant Humphries
Having a bit of a struggle with what seems like it should be a simple issue... Essentially I have some sites where counts of objects occurred over several years: Example: site_id = Site1: (Year:2012,Count:133), (Year:2011, Count:150), (Year:2010, Count :110) site_id = Site2: (Year:2010, Cou

Get value of related field using MAX value with annotate.

2015-11-24 Thread Grant Humphries
Having a bit of a struggle with what seems like it should be a simple issue... Essentially I have some sites where counts of objects occurred over several years: Example: site_id = Site1: (Year:2012,Count:133), (Year:2011, Count:150), (Year:2010, Count :110) site_id = Site2: (Year:2010, Cou

Re: using Max()

2009-08-14 Thread neridaj
Thanks again Karen. On Aug 13, 7:40 pm, Karen Tracey wrote: > On Thu, Aug 13, 2009 at 5:01 PM, neri...@gmail.com wrote: > > > > > > > Hello, > > > Do I need t convert the value returned from Max() to an int, or am I > > using it incorrectly? I'm getting this template error: > > > Caught an excep

Re: using Max()

2009-08-13 Thread Karen Tracey
On Thu, Aug 13, 2009 at 5:01 PM, neri...@gmail.com wrote: > > Hello, > > Do I need t convert the value returned from Max() to an int, or am I > using it incorrectly? I'm getting this template error: > > Caught an exception while rendering: (1064, "You have an error in your > SQL syntax; check the

using Max()

2009-08-13 Thread neri...@gmail.com
Hello, Do I need t convert the value returned from Max() to an int, or am I using it incorrectly? I'm getting this template error: Caught an exception while rendering: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right synta