Has anyone else but me had this problem before? I have created an SQL query
using the PL/SQL Developer tool while connected up to an Oracle database.
The query works fine. Then I transfer the SQL query copy/paste to the
Generic Query Designer of RS2000, set my parameters and shared data source
correctly. I then click refresh fields and get the following error.
Could not generate a list of fields for the query.
Check the query syntax or click Refresh Fields on the query toolbar.
ExecuteReader requires an open and available Connection. The connection's
current state is Closed.
At this point I double check my syntax and connection and notice that the
parameters I have previously set up have been obliterated and I reassign
them. I try again only to experience the same error.
Here is the text of my query. I also have another very similar query that
works just fine. BTW, this query was longer at one point and I shortened it,
immediately thereafter it started behaving this way. Why am I experiencing
this behavior?
SELECT
COUNT(*) RespondentCount
,SUM(CASE WHEN s.surveysetting IS NULL THEN 1
WHEN s.surveysetting NOT IN(0,1,2) THEN 1
ELSE 0 END) SurveySettingUnknown
,SUM(CASE s.surveysetting WHEN '0' THEN 1 ELSE 0 END)
SurveySettingInProcessing
,SUM(CASE s.surveysetting WHEN '1' THEN 1 ELSE 0 END) PreDeployment
,SUM(CASE s.surveysetting WHEN '2' THEN 1 ELSE 0 END) PostDeployment
,SUM(CASE WHEN s.surveysetting = 1 AND s.gender = 'M' THEN 1 ELSE 0 END)
PreDeploymentMale
,SUM(CASE WHEN s.surveysetting = 2 AND s.gender = 'M' THEN 1 ELSE 0 END)
PostDeploymentMale
,SUM(CASE WHEN s.surveysetting = 1 AND s.gender = 'F' THEN 1 ELSE 0 END)
PreDeploymentFemale
,SUM(CASE WHEN s.surveysetting = 2 AND s.gender = 'F' THEN 1 ELSE 0 END)
PostDeploymentFemale
,SUM(CASE WHEN s.surveysetting = 1 AND TO_DATE(s.dob, 'MM/DD/YYYY')
BETWEEN ADD_MONTHS(SYSDATE, -252)+1 AND SYSDATE THEN 1 ELSE 0 END)
AgePreDeployLTE20
,SUM(CASE WHEN s.surveysetting = 2 AND TO_DATE(s.dob, 'MM/DD/YYYY')
BETWEEN ADD_MONTHS(SYSDATE, -252)+1 AND SYSDATE THEN 1 ELSE 0 END)
AgePostDeployLTE20
,SUM(CASE WHEN s.surveysetting = 1 AND TO_DATE(s.dob, 'MM/DD/YYYY')
BETWEEN ADD_MONTHS(SYSDATE, -372)+1 AND ADD_MONTHS(SYSDATE, -252) THEN 1 ELSE
0 END) AgePreDeployBT21and30
,SUM(CASE WHEN s.surveysetting = 2 AND TO_DATE(s.dob, 'MM/DD/YYYY')
BETWEEN ADD_MONTHS(SYSDATE, -372)+1 AND ADD_MONTHS(SYSDATE, -252) THEN 1 ELSE
0 END) AgePostDeployBT21and30
,SUM(CASE WHEN s.surveysetting = 1 AND TO_DATE(s.dob, 'MM/DD/YYYY')
BETWEEN ADD_MONTHS(SYSDATE, -492)+1 AND ADD_MONTHS(SYSDATE, -372) THEN 1 ELSE
0 END) AgePreDeployBT31and40
,SUM(CASE WHEN s.surveysetting = 2 AND TO_DATE(s.dob, 'MM/DD/YYYY')
BETWEEN ADD_MONTHS(SYSDATE, -492)+1 AND ADD_MONTHS(SYSDATE, -372) THEN 1 ELSE
0 END) AgePostDeployBT31and40
,SUM(CASE WHEN s.surveysetting = 1 AND TO_DATE(s.dob, 'MM/DD/YYYY')
BETWEEN ADD_MONTHS(SYSDATE, -612)+1 AND ADD_MONTHS(SYSDATE, -492) THEN 1 ELSE
0 END) AgePreDeployBT41and50
,SUM(CASE WHEN s.surveysetting = 2 AND TO_DATE(s.dob, 'MM/DD/YYYY')
BETWEEN ADD_MONTHS(SYSDATE, -612)+1 AND ADD_MONTHS(SYSDATE, -492) THEN 1 ELSE
0 END) AgePostDeployBT41and50
,SUM(CASE WHEN s.surveysetting = 1 AND TO_DATE(s.dob, 'MM/DD/YYYY') >= ADD_MONTHS(SYSDATE, -612) THEN 1 ELSE 0 END) AgePreDeployGTE51
,SUM(CASE WHEN s.surveysetting = 2 AND TO_DATE(s.dob, 'MM/DD/YYYY') >= ADD_MONTHS(SYSDATE, -612) THEN 1 ELSE 0 END) AgePostDeployGTE51
,SUM(CASE WHEN s.surveysetting = 1 AND s.paygrade IN('E-1', 'E-2', 'E-3')
THEN 1 ELSE 0 END) PayPreDeployBTE1andE3
,SUM(CASE WHEN s.surveysetting = 2 AND s.paygrade IN('E-1', 'E-2', 'E-3')
THEN 1 ELSE 0 END) PayPostDeployBTE1andE3
,SUM(CASE WHEN s.surveysetting = 1 AND s.paygrade IN('E-4', 'E-5', 'E-6')
THEN 1 ELSE 0 END) PayPreDeployBTE4andE6
,SUM(CASE WHEN s.surveysetting = 2 AND s.paygrade IN('E-4', 'E-5', 'E-6')
THEN 1 ELSE 0 END) PayPostDeployBTE4andE6
,SUM(CASE WHEN s.surveysetting = 1 AND s.paygrade IN('E-7', 'E-8', 'E-9')
THEN 1 ELSE 0 END) PayPreDeployBTE7andE9
,SUM(CASE WHEN s.surveysetting = 2 AND s.paygrade IN('E-7', 'E-8', 'E-9')
THEN 1 ELSE 0 END) PayPostDeployBTE7andE9
,SUM(CASE WHEN s.surveysetting = 1 AND s.paygrade IN('W-1', 'W-2', 'W-3')
THEN 1 ELSE 0 END) PayPreDeployBTW1andW3
,SUM(CASE WHEN s.surveysetting = 2 AND s.paygrade IN('W-1', 'W-2', 'W-3')
THEN 1 ELSE 0 END) PayPostDeployBTW1andW3
,SUM(CASE WHEN s.surveysetting = 1 AND s.paygrade IN('W-4', 'W-5') THEN 1
ELSE 0 END) PayPreDeployInW4andW5
,SUM(CASE WHEN s.surveysetting = 2 AND s.paygrade IN('W-4', 'W-5') THEN 1
ELSE 0 END) PayPostDeployInW4andW5
,SUM(CASE WHEN s.surveysetting = 1 AND s.paygrade IN('O-1', 'O-2', 'O-3')
THEN 1 ELSE 0 END) PayPreDeployBTO1andO3
,SUM(CASE WHEN s.surveysetting = 2 AND s.paygrade IN('O-1', 'O-2', 'O-3')
THEN 1 ELSE 0 END) PayPostDeployBTO1andO3
,SUM(CASE WHEN s.surveysetting = 1 AND s.paygrade IN('O-4', 'O-5', 'O-6')
THEN 1 ELSE 0 END) PayPreDeployBTO4andO6
,SUM(CASE WHEN s.surveysetting = 2 AND s.paygrade IN('O-4', 'O-5', 'O-6')
THEN 1 ELSE 0 END) PayPostDeployBTO4andO6
,SUM(CASE WHEN s.surveysetting = 1 AND s.paygrade IN('O-7', 'O-8', 'O-9',
'O-10') THEN 1 ELSE 0 END) PayPreDeployBTO7andO10
,SUM(CASE WHEN s.surveysetting = 2 AND s.paygrade IN('O-7', 'O-8', 'O-9',
'O-10') THEN 1 ELSE 0 END) PayPostDeployBTO7andO10
,SUM(CASE WHEN s.last_2_yearsdeployed = 1 THEN 1 ELSE 0 END)
Last2YearsDeployed
,SUM(CASE WHEN s.surveysetting = 1 AND s.numberoifdeployments = 1 THEN 1
ELSE 0 END) OifPreDeployments_1
,SUM(CASE WHEN s.surveysetting = 2 AND s.numberoifdeployments = 1 THEN 1
ELSE 0 END) OifPostDeployments_1
,SUM(CASE WHEN s.surveysetting = 1 AND s.numberoifdeployments = 2 THEN 1
ELSE 0 END) OifPreDeployments_2
,SUM(CASE WHEN s.surveysetting = 2 AND s.numberoifdeployments = 2 THEN 1
ELSE 0 END) OifPostDeployments_2
,SUM(CASE WHEN s.surveysetting = 1 AND s.numberoifdeployments = 3 THEN 1
ELSE 0 END) OifPreDeployments_3
,SUM(CASE WHEN s.surveysetting = 2 AND s.numberoifdeployments = 3 THEN 1
ELSE 0 END) OifPostDeployments_3
,SUM(CASE WHEN s.surveysetting = 1 AND s.numberoifdeployments = 4 THEN 1
ELSE 0 END) OifPreDeployments_4
,SUM(CASE WHEN s.surveysetting = 2 AND s.numberoifdeployments = 4 THEN 1
ELSE 0 END) OifPostDeployments_4
,SUM(CASE WHEN s.surveysetting = 1 AND s.numberoifdeployments >= 5 THEN 1
ELSE 0 END) OifPreDeployments_5Plus
,SUM(CASE WHEN s.surveysetting = 2 AND s.numberoifdeployments >= 5 THEN 1
ELSE 0 END) OifPostDeployments_5Plus
,SUM(CASE WHEN s.surveysetting = 1 AND s.numberoefdeployments = 1 THEN 1
ELSE 0 END) OefPreDeployments_1
,SUM(CASE WHEN s.surveysetting = 2 AND s.numberoefdeployments = 1 THEN 1
ELSE 0 END) OefPostDeployments_1
,SUM(CASE WHEN s.surveysetting = 1 AND s.numberoefdeployments = 2 THEN 1
ELSE 0 END) OefPreDeployments_2
,SUM(CASE WHEN s.surveysetting = 2 AND s.numberoefdeployments = 2 THEN 1
ELSE 0 END) OefPostDeployments_2
,SUM(CASE WHEN s.surveysetting = 1 AND s.numberoefdeployments = 3 THEN 1
ELSE 0 END) OefPreDeployments_3
,SUM(CASE WHEN s.surveysetting = 2 AND s.numberoefdeployments = 3 THEN 1
ELSE 0 END) OefPostDeployments_3
,SUM(CASE WHEN s.surveysetting = 1 AND s.numberoefdeployments = 4 THEN 1
ELSE 0 END) OefPreDeployments_4
,SUM(CASE WHEN s.surveysetting = 2 AND s.numberoefdeployments = 4 THEN 1
ELSE 0 END) OefPostDeployments_4
,SUM(CASE WHEN s.surveysetting = 1 AND s.numberoefdeployments >= 5 THEN 1
ELSE 0 END) OefPreDeployments_5Plus
,SUM(CASE WHEN s.surveysetting = 2 AND s.numberoefdeployments >= 5 THEN 1
ELSE 0 END) OefPostDeployments_5Plus
,SUM(CASE WHEN s.surveysetting = 1 AND s.numberotherdeployments = 1 THEN 1
ELSE 0 END) OtherPreDeployments_1
,SUM(CASE WHEN s.surveysetting = 2 AND s.numberotherdeployments = 1 THEN 1
ELSE 0 END) OtherPostDeployments_1
,SUM(CASE WHEN s.surveysetting = 1 AND s.numberotherdeployments = 2 THEN 1
ELSE 0 END) OtherPreDeployments_2
,SUM(CASE WHEN s.surveysetting = 2 AND s.numberotherdeployments = 2 THEN 1
ELSE 0 END) OtherPostDeployments_2
,SUM(CASE WHEN s.surveysetting = 1 AND s.numberotherdeployments = 3 THEN 1
ELSE 0 END) OtherPreDeployments_3
,SUM(CASE WHEN s.surveysetting = 2 AND s.numberotherdeployments = 3 THEN 1
ELSE 0 END) OtherPostDeployments_3
,SUM(CASE WHEN s.surveysetting = 1 AND s.numberotherdeployments = 4 THEN 1
ELSE 0 END) OtherPreDeployments_4
,SUM(CASE WHEN s.surveysetting = 2 AND s.numberotherdeployments = 4 THEN 1
ELSE 0 END) OtherPostDeployments_4
,SUM(CASE WHEN s.surveysetting = 1 AND s.numberotherdeployments >= 5 THEN
1 ELSE 0 END) OtherPreDeployments_5Plus
,SUM(CASE WHEN s.surveysetting = 2 AND s.numberotherdeployments >= 5 THEN
1 ELSE 0 END) OtherPostDeployments_5Plus
,SUM(CASE WHEN s.surveysetting = 1 AND s.combatinjured = 1 THEN 1 ELSE 0
END) PreCombatInjured
,SUM(CASE WHEN s.surveysetting = 2 AND s.combatinjured = 1 THEN 1 ELSE 0
END) PostCombatInjured
,SUM(CASE WHEN s.surveysetting = 1 AND s.deploymenthealthconcern = 1 THEN
1 ELSE 0 END) PreDeploymentHealthConcern
,SUM(CASE WHEN s.surveysetting = 2 AND s.deploymenthealthconcern = 1 THEN
1 ELSE 0 END) PostDeploymentHealthConcern
FROM
hermes.surveyhraiiv2results s
WHERE
s.surveydate BETWEEN ? AND ?
--
Thank you,
JohnI deleted the dataset in question and then recreated it using the below query
and now it all works fine. This appears to be an obvious bug and should be
fixed.
--
Thank you,
John
"John A" wrote:
> Has anyone else but me had this problem before? I have created an SQL query
> using the PL/SQL Developer tool while connected up to an Oracle database.
> The query works fine. Then I transfer the SQL query copy/paste to the
> Generic Query Designer of RS2000, set my parameters and shared data source
> correctly. I then click refresh fields and get the following error.
> Could not generate a list of fields for the query.
> Check the query syntax or click Refresh Fields on the query toolbar.
> ExecuteReader requires an open and available Connection. The connection's
> current state is Closed.
> At this point I double check my syntax and connection and notice that the
> parameters I have previously set up have been obliterated and I reassign
> them. I try again only to experience the same error.
> Here is the text of my query. I also have another very similar query that
> works just fine. BTW, this query was longer at one point and I shortened it,
> immediately thereafter it started behaving this way. Why am I experiencing
> this behavior?
> SELECT
> COUNT(*) RespondentCount
> ,SUM(CASE WHEN s.surveysetting IS NULL THEN 1
> WHEN s.surveysetting NOT IN(0,1,2) THEN 1
> ELSE 0 END) SurveySettingUnknown
> ,SUM(CASE s.surveysetting WHEN '0' THEN 1 ELSE 0 END)
> SurveySettingInProcessing
> ,SUM(CASE s.surveysetting WHEN '1' THEN 1 ELSE 0 END) PreDeployment
> ,SUM(CASE s.surveysetting WHEN '2' THEN 1 ELSE 0 END) PostDeployment
> ,SUM(CASE WHEN s.surveysetting = 1 AND s.gender = 'M' THEN 1 ELSE 0 END)
> PreDeploymentMale
> ,SUM(CASE WHEN s.surveysetting = 2 AND s.gender = 'M' THEN 1 ELSE 0 END)
> PostDeploymentMale
> ,SUM(CASE WHEN s.surveysetting = 1 AND s.gender = 'F' THEN 1 ELSE 0 END)
> PreDeploymentFemale
> ,SUM(CASE WHEN s.surveysetting = 2 AND s.gender = 'F' THEN 1 ELSE 0 END)
> PostDeploymentFemale
> ,SUM(CASE WHEN s.surveysetting = 1 AND TO_DATE(s.dob, 'MM/DD/YYYY')
> BETWEEN ADD_MONTHS(SYSDATE, -252)+1 AND SYSDATE THEN 1 ELSE 0 END)
> AgePreDeployLTE20
> ,SUM(CASE WHEN s.surveysetting = 2 AND TO_DATE(s.dob, 'MM/DD/YYYY')
> BETWEEN ADD_MONTHS(SYSDATE, -252)+1 AND SYSDATE THEN 1 ELSE 0 END)
> AgePostDeployLTE20
> ,SUM(CASE WHEN s.surveysetting = 1 AND TO_DATE(s.dob, 'MM/DD/YYYY')
> BETWEEN ADD_MONTHS(SYSDATE, -372)+1 AND ADD_MONTHS(SYSDATE, -252) THEN 1 ELSE
> 0 END) AgePreDeployBT21and30
> ,SUM(CASE WHEN s.surveysetting = 2 AND TO_DATE(s.dob, 'MM/DD/YYYY')
> BETWEEN ADD_MONTHS(SYSDATE, -372)+1 AND ADD_MONTHS(SYSDATE, -252) THEN 1 ELSE
> 0 END) AgePostDeployBT21and30
> ,SUM(CASE WHEN s.surveysetting = 1 AND TO_DATE(s.dob, 'MM/DD/YYYY')
> BETWEEN ADD_MONTHS(SYSDATE, -492)+1 AND ADD_MONTHS(SYSDATE, -372) THEN 1 ELSE
> 0 END) AgePreDeployBT31and40
> ,SUM(CASE WHEN s.surveysetting = 2 AND TO_DATE(s.dob, 'MM/DD/YYYY')
> BETWEEN ADD_MONTHS(SYSDATE, -492)+1 AND ADD_MONTHS(SYSDATE, -372) THEN 1 ELSE
> 0 END) AgePostDeployBT31and40
> ,SUM(CASE WHEN s.surveysetting = 1 AND TO_DATE(s.dob, 'MM/DD/YYYY')
> BETWEEN ADD_MONTHS(SYSDATE, -612)+1 AND ADD_MONTHS(SYSDATE, -492) THEN 1 ELSE
> 0 END) AgePreDeployBT41and50
> ,SUM(CASE WHEN s.surveysetting = 2 AND TO_DATE(s.dob, 'MM/DD/YYYY')
> BETWEEN ADD_MONTHS(SYSDATE, -612)+1 AND ADD_MONTHS(SYSDATE, -492) THEN 1 ELSE
> 0 END) AgePostDeployBT41and50
> ,SUM(CASE WHEN s.surveysetting = 1 AND TO_DATE(s.dob, 'MM/DD/YYYY') >=> ADD_MONTHS(SYSDATE, -612) THEN 1 ELSE 0 END) AgePreDeployGTE51
> ,SUM(CASE WHEN s.surveysetting = 2 AND TO_DATE(s.dob, 'MM/DD/YYYY') >=> ADD_MONTHS(SYSDATE, -612) THEN 1 ELSE 0 END) AgePostDeployGTE51
> ,SUM(CASE WHEN s.surveysetting = 1 AND s.paygrade IN('E-1', 'E-2', 'E-3')
> THEN 1 ELSE 0 END) PayPreDeployBTE1andE3
> ,SUM(CASE WHEN s.surveysetting = 2 AND s.paygrade IN('E-1', 'E-2', 'E-3')
> THEN 1 ELSE 0 END) PayPostDeployBTE1andE3
> ,SUM(CASE WHEN s.surveysetting = 1 AND s.paygrade IN('E-4', 'E-5', 'E-6')
> THEN 1 ELSE 0 END) PayPreDeployBTE4andE6
> ,SUM(CASE WHEN s.surveysetting = 2 AND s.paygrade IN('E-4', 'E-5', 'E-6')
> THEN 1 ELSE 0 END) PayPostDeployBTE4andE6
> ,SUM(CASE WHEN s.surveysetting = 1 AND s.paygrade IN('E-7', 'E-8', 'E-9')
> THEN 1 ELSE 0 END) PayPreDeployBTE7andE9
> ,SUM(CASE WHEN s.surveysetting = 2 AND s.paygrade IN('E-7', 'E-8', 'E-9')
> THEN 1 ELSE 0 END) PayPostDeployBTE7andE9
> ,SUM(CASE WHEN s.surveysetting = 1 AND s.paygrade IN('W-1', 'W-2', 'W-3')
> THEN 1 ELSE 0 END) PayPreDeployBTW1andW3
> ,SUM(CASE WHEN s.surveysetting = 2 AND s.paygrade IN('W-1', 'W-2', 'W-3')
> THEN 1 ELSE 0 END) PayPostDeployBTW1andW3
> ,SUM(CASE WHEN s.surveysetting = 1 AND s.paygrade IN('W-4', 'W-5') THEN 1
> ELSE 0 END) PayPreDeployInW4andW5
> ,SUM(CASE WHEN s.surveysetting = 2 AND s.paygrade IN('W-4', 'W-5') THEN 1
> ELSE 0 END) PayPostDeployInW4andW5
> ,SUM(CASE WHEN s.surveysetting = 1 AND s.paygrade IN('O-1', 'O-2', 'O-3')
> THEN 1 ELSE 0 END) PayPreDeployBTO1andO3
> ,SUM(CASE WHEN s.surveysetting = 2 AND s.paygrade IN('O-1', 'O-2', 'O-3')
> THEN 1 ELSE 0 END) PayPostDeployBTO1andO3
> ,SUM(CASE WHEN s.surveysetting = 1 AND s.paygrade IN('O-4', 'O-5', 'O-6')
> THEN 1 ELSE 0 END) PayPreDeployBTO4andO6
> ,SUM(CASE WHEN s.surveysetting = 2 AND s.paygrade IN('O-4', 'O-5', 'O-6')
> THEN 1 ELSE 0 END) PayPostDeployBTO4andO6
> ,SUM(CASE WHEN s.surveysetting = 1 AND s.paygrade IN('O-7', 'O-8', 'O-9',
> 'O-10') THEN 1 ELSE 0 END) PayPreDeployBTO7andO10
> ,SUM(CASE WHEN s.surveysetting = 2 AND s.paygrade IN('O-7', 'O-8', 'O-9',
> 'O-10') THEN 1 ELSE 0 END) PayPostDeployBTO7andO10
> ,SUM(CASE WHEN s.last_2_yearsdeployed = 1 THEN 1 ELSE 0 END)
> Last2YearsDeployed
> ,SUM(CASE WHEN s.surveysetting = 1 AND s.numberoifdeployments = 1 THEN 1
> ELSE 0 END) OifPreDeployments_1
> ,SUM(CASE WHEN s.surveysetting = 2 AND s.numberoifdeployments = 1 THEN 1
> ELSE 0 END) OifPostDeployments_1
> ,SUM(CASE WHEN s.surveysetting = 1 AND s.numberoifdeployments = 2 THEN 1
> ELSE 0 END) OifPreDeployments_2
> ,SUM(CASE WHEN s.surveysetting = 2 AND s.numberoifdeployments = 2 THEN 1
> ELSE 0 END) OifPostDeployments_2
> ,SUM(CASE WHEN s.surveysetting = 1 AND s.numberoifdeployments = 3 THEN 1
> ELSE 0 END) OifPreDeployments_3
> ,SUM(CASE WHEN s.surveysetting = 2 AND s.numberoifdeployments = 3 THEN 1
> ELSE 0 END) OifPostDeployments_3
> ,SUM(CASE WHEN s.surveysetting = 1 AND s.numberoifdeployments = 4 THEN 1
> ELSE 0 END) OifPreDeployments_4
> ,SUM(CASE WHEN s.surveysetting = 2 AND s.numberoifdeployments = 4 THEN 1
> ELSE 0 END) OifPostDeployments_4
> ,SUM(CASE WHEN s.surveysetting = 1 AND s.numberoifdeployments >= 5 THEN 1
> ELSE 0 END) OifPreDeployments_5Plus
> ,SUM(CASE WHEN s.surveysetting = 2 AND s.numberoifdeployments >= 5 THEN 1
> ELSE 0 END) OifPostDeployments_5Plus
> ,SUM(CASE WHEN s.surveysetting = 1 AND s.numberoefdeployments = 1 THEN 1
> ELSE 0 END) OefPreDeployments_1
> ,SUM(CASE WHEN s.surveysetting = 2 AND s.numberoefdeployments = 1 THEN 1
> ELSE 0 END) OefPostDeployments_1
> ,SUM(CASE WHEN s.surveysetting = 1 AND s.numberoefdeployments = 2 THEN 1
> ELSE 0 END) OefPreDeployments_2
> ,SUM(CASE WHEN s.surveysetting = 2 AND s.numberoefdeployments = 2 THEN 1
> ELSE 0 END) OefPostDeployments_2
> ,SUM(CASE WHEN s.surveysetting = 1 AND s.numberoefdeployments = 3 THEN 1
> ELSE 0 END) OefPreDeployments_3
> ,SUM(CASE WHEN s.surveysetting = 2 AND s.numberoefdeployments = 3 THEN 1
> ELSE 0 END) OefPostDeployments_3
> ,SUM(CASE WHEN s.surveysetting = 1 AND s.numberoefdeployments = 4 THEN 1
> ELSE 0 END) OefPreDeployments_4
> ,SUM(CASE WHEN s.surveysetting = 2 AND s.numberoefdeployments = 4 THEN 1
> ELSE 0 END) OefPostDeployments_4
> ,SUM(CASE WHEN s.surveysetting = 1 AND s.numberoefdeployments >= 5 THEN 1
> ELSE 0 END) OefPreDeployments_5Plus
> ,SUM(CASE WHEN s.surveysetting = 2 AND s.numberoefdeployments >= 5 THEN 1
> ELSE 0 END) OefPostDeployments_5Plus
> ,SUM(CASE WHEN s.surveysetting = 1 AND s.numberotherdeployments = 1 THEN 1
> ELSE 0 END) OtherPreDeployments_1
> ,SUM(CASE WHEN s.surveysetting = 2 AND s.numberotherdeployments = 1 THEN 1
> ELSE 0 END) OtherPostDeployments_1
> ,SUM(CASE WHEN s.surveysetting = 1 AND s.numberotherdeployments = 2 THEN 1
> ELSE 0 END) OtherPreDeployments_2
> ,SUM(CASE WHEN s.surveysetting = 2 AND s.numberotherdeployments = 2 THEN 1
> ELSE 0 END) OtherPostDeployments_2
> ,SUM(CASE WHEN s.surveysetting = 1 AND s.numberotherdeployments = 3 THEN 1
> ELSE 0 END) OtherPreDeployments_3
> ,SUM(CASE WHEN s.surveysetting = 2 AND s.numberotherdeployments = 3 THEN 1
> ELSE 0 END) OtherPostDeployments_3
> ,SUM(CASE WHEN s.surveysetting = 1 AND s.numberotherdeployments = 4 THEN 1
> ELSE 0 END) OtherPreDeployments_4
> ,SUM(CASE WHEN s.surveysetting = 2 AND s.numberotherdeployments = 4 THEN 1
> ELSE 0 END) OtherPostDeployments_4
> ,SUM(CASE WHEN s.surveysetting = 1 AND s.numberotherdeployments >= 5 THEN
> 1 ELSE 0 END) OtherPreDeployments_5Plus
> ,SUM(CASE WHEN s.surveysetting = 2 AND s.numberotherdeployments >= 5 THEN
> 1 ELSE 0 END) OtherPostDeployments_5Plus
> ,SUM(CASE WHEN s.surveysetting = 1 AND s.combatinjured = 1 THEN 1 ELSE 0
> END) PreCombatInjured
> ,SUM(CASE WHEN s.surveysetting = 2 AND s.combatinjured = 1 THEN 1 ELSE 0
> END) PostCombatInjured
> ,SUM(CASE WHEN s.surveysetting = 1 AND s.deploymenthealthconcern = 1 THEN
> 1 ELSE 0 END) PreDeploymentHealthConcern
> ,SUM(CASE WHEN s.surveysetting = 2 AND s.deploymenthealthconcern = 1 THEN
> 1 ELSE 0 END) PostDeploymentHealthConcern
> FROM
> hermes.surveyhraiiv2results s
> WHERE
> s.surveydate BETWEEN ? AND ?
>
>
> --
> Thank you,
> John|||Hi John,
Thanks for suggestion. I will submit this through internal method to
development team. If there is any feedback, I will post here as a follow up.
In the meanwhile, you are also encouraged to submit this via the link below
http://lab.msdn.microsoft.com/productfeedback/default.aspx
Sincerely yours,
Michael Cheng
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=====================================================This posting is provided "AS IS" with no warranties, and confers no rights.