On 10/08/2011 17:12, Conor66 wrote:
Thanks for your reply. Yes I looked into Calendar.WEEK_OF_YEAR, I came across
it after I wrote that CASE statement and it would definitely be a better way
to do this. But Im wondering how to get the weeks where nothing happens, so
that I can have zero values also, not just the weeks where something
happens.
Left join should do the trick; A left join B on C will give you all the
rows from A, with either matching data from B or nulls where there is no
matching data. A case clause can be used to turn the nulls into zeroes
or whatever else is needed.
Cheers,
------------------------------------------------------------------------
John English | My old University of Brighton home page is still here:
| http://www.it.brighton.ac.uk/staff/je
------------------------------------------------------------------------