Format date as yyyy-MM-ddThh:mm:ssZ
04:14 24 May 2011

I need to format a set of dates in SQL Server to the following format.

yyyy-MM-ddThh:mm:ssZ

I can't seem to find how to format the date with the T and Z parts included in the string

Any ideas how to achieve this format in a SQL Server query?

sql-server t-sql