Can somebody help me with this SQL Query.
In the following table, RESPONSES counts how many times SEGMENT has responded on CHECKED date.
CREATE TABLE #
You need to use dynamic SQL. See this blog post for an example. Another example, different blog, same approach.
If your columns are static and you're using SQL Server 2005 and higher you can use the PIVOT feature to perform this type of query.