I have the following columns in table ZLDT025_STDNTRSPNS
STDNT_NB student number
CRS_NB - Course Number
CRS_VRSN_NB Course Version Number
QSTN_SQNC_NB Question Number values (1-15)
ANSW_OPT_CD —Answer Option Code (A-E)
RSPNS_DT -Response Date
I am trying to create a report to get the responses(count) with answ_opt_Cd A by total number of responses for questions 1-5 Grouping by Response year and responses(count) with answ_opt_Cd A by total number of responses for questions 6-10 Grouping by Response year .I am having Issues
SELECT
dbo.ZLDT030_CRS.CRS_NM,
dbo.ZLDT075_CRRCLM_CRS.CRS_NB,
dbo.ZLDT075_CRRCLM_CRS.CRS_VRSN_NB
FROM
dbo.ZLDT030_CRS,
dbo.ZLDT075_CRRCLM_CRS
WHERE
( dbo.ZLDT075_CRRCLM_CRS.CRS_NB=dbo.ZLDT030_CRS.CRS_NB and dbo.ZLDT075_CRRCLM_CRS.CRS_VRSN_NB=dbo.ZLDT030_CRS.CRS_VRSN_NB )
AND (
dbo.ZLDT030_CRS.CRS_DLVRY_CD IN (4, 2, 1)
AND dbo.ZLDT030_CRS.CRS_STAT_CD = '1'
)
SELECT
dbo.ZLDT030_CRS.CRS_NM,
dbo.ZLDT025_STDNTRSPNS.ANSW_OPT_CD,
count(dbo.ZLDT025_STDNTRSPNS.STDNT_NB),
count(dbo.ZLDT025_STDNTRSPNS.STDNT_NB),
dbo.ZLDT025_STDNTRSPNS.QSTN_SQNC_NB,
count(dbo.ZLDT025_STDNTRSPNS.STDNT_NB)
FROM
dbo.ZLDT030_CRS,
dbo.ZLDT025_STDNTRSPNS
WHERE
( dbo.ZLDT030_CRS.CRS_NB=dbo.ZLDT025_STDNTRSPNS.CRS_NB and dbo.ZLDT030_CRS.CRS_VRSN_NB=dbo.ZLDT025_STDNTRSPNS.CRS_VRSN_NB )
AND ( dbo.ZLDT025_STDNTRSPNS.QSTN_SQNC_NB IN (1,2,3,4,5) and dbo.ZLDT025_STDNTRSPNS.QSTN_CATG_CD in('EC','MC') )
AND ( dbo.ZLDT025_STDNTRSPNS.QSTN_SQNC_NB IN (6,7,8,9,10)) and dbo.ZLDT025_STDNTRSPNS.QSTN_CATG_CD in('EC','MC') )
AND (
dbo.ZLDT030_CRS.CRS_DLVRY_CD IN (4, 2, 1)
AND dbo.ZLDT030_CRS.CRS_STAT_CD = '1'
)
GROUP BY
dbo.ZLDT030_CRS.CRS_NM,
dbo.ZLDT025_STDNTRSPNS.ANSW_OPT_CD,
dbo.ZLDT025_STDNTRSPNS.QSTN_SQNC_NB
[Used bbc CODE formatting, please use the formatting options when you post - Andreas]
AND ( dbo.ZLDT025_STDNTRSPNS.QSTN_SQNC_NB IN (1,2,3,4,5) and dbo.ZLDT025_STDNTRSPNS.QSTN_CATG_CD in(‘EC’,‘MC’) ) AND ( dbo.ZLDT025_STDNTRSPNS.QSTN_SQNC_NB IN (6,7,8,9,10)) and
have the following columns in table ZLDT025_STDNTRSPNS
STDNT_NB student number
CRS_NB - Course Number
CRS_VRSN_NB Course Version Number
QSTN_SQNC_NB Question Number values (1-15)
ANSW_OPT_CD —Answer Option Code (A-E)
RSPNS_DT -Response Date
I am trying to create a report to get the responses(count) with answ_opt_Cd A by total number of responses for questions 1-5 Grouping by Response year and responses(count) with answ_opt_Cd A by total number of responses for questions 6-10 Grouping by Response year .I am having Issues
Have a look on www.google.com for a SQL reference/tutorial download for the RDBMS that you are using. This should be your priority over Designer. Then book some training.
Please use SEARCH as CASE statements have been covered many times. This topic will appears as a pointless post for anyone in future who is searching for examples of CASE statements.
This is a FREE knowledge sharing forum and I love being a part of it.
If possible, email your report to me. I will take a look. You need not to pay anything 8).