• You're definitely on the right track to give us what we need to help you and reading the forum etiquette article was a smart thing to do.

    You didn't provide the DDL I asked for but I found that the DDL I used was good enough, so after changing the double quotes to single quotes and removing the last UNION ALL, this will run for me:

    DECLARE @Imbibing TABLE

    (ClientID INT, DOV DATE, Form VARCHAR(10), QuestionID VARCHAR(20), Response INT)

    INSERT INTO @Imbibing

    SELECT '7','2012-03-01','Audit','Alcohol1-001','0' UNION ALL

    SELECT '7','2012-03-01','Audit','Alcohol1-001','0' UNION ALL

    SELECT '8','2011-08-09','Audit','Alcohol1-001','0' UNION ALL

    SELECT '8','2011-08-09','Audit','Alcohol2-002','0' UNION ALL

    SELECT '8','2012-01-11','Audit','Alcohol1-001','0' UNION ALL

    SELECT '8','2012-01-11','Audit','Alcohol2-002','0' UNION ALL

    SELECT '9','2011-08-24','Audit','Alcohol1-001','0' UNION ALL

    SELECT '9','2011-08-24','Audit','Alcohol2-002','0' UNION ALL

    SELECT '9','2012-02-18','Audit','Alcohol1-001','1' UNION ALL

    SELECT '9','2012-02-18','Audit','Alcohol2-002','0' UNION ALL

    SELECT '12','2012-02-14','Audit','Alcohol1-001','0' UNION ALL

    SELECT '12','2012-02-14','Audit','Alcohol2-002','0' UNION ALL

    SELECT '13','2011-09-28','Audit','Alcohol1-001','0' UNION ALL

    SELECT '43','2011-11-01','Audit','Alcohol1-001','0' UNION ALL

    SELECT '44','2011-11-21','Audit','Alcohol1-001','0' UNION ALL

    SELECT '157','2012-02-29','Audit','Alcohol1-001','0' UNION ALL

    SELECT '157','2012-06-20','Audit','Alcohol1-001','0' UNION ALL

    SELECT '158','2012-03-21','Audit','Alcohol1-001','0' UNION ALL

    SELECT '158','2012-07-11','Audit','Alcohol1-001','1' UNION ALL

    SELECT '160','2012-06-19','Audit','Alcohol1-001','0' UNION ALL

    SELECT '160','2012-11-09','Audit','Alcohol1-001','0' UNION ALL

    SELECT '164','2012-07-17','Audit','Alcohol1-001','0' UNION ALL

    SELECT '174','2012-06-06','Audit','Alcohol1-001','1' UNION ALL

    SELECT '178','2012-07-17','Audit','Alcohol1-001','0'

    SELECT * FROM @Imbibing

    Now here is the issue. The BMP you provided shows the SELECT statements above that I've inserted into the temporary table. What it should show is the exact expected results based on the sample data you provided.


    My mantra: No loops! No CURSORs! No RBAR! Hoo-uh![/I]

    My thought question: Have you ever been told that your query runs too fast?

    My advice:
    INDEXing a poor-performing query is like putting sugar on cat food. Yeah, it probably tastes better but are you sure you want to eat it?
    The path of least resistance can be a slippery slope. Take care that fixing your fixes of fixes doesn't snowball and end up costing you more than fixing the root cause would have in the first place.

    Need to UNPIVOT? Why not CROSS APPLY VALUES instead?[/url]
    Since random numbers are too important to be left to chance, let's generate some![/url]
    Learn to understand recursive CTEs by example.[/url]
    [url url=http://www.sqlservercentral.com/articles/St