I need help with this ColdFusion Query Logic?
I need help with this ColdFusion Query Logic? Can anyone tell me what is wrong with the WHERE statement in the cfquery statement?
cfparam name=form.Cohorts default=200808
cfquery name=RPGGradRates_Data datasource=RPG
SELECT Main_Cohort_Table.Banner, Main_Cohort_Table.GENDER, [Race Validation].RACE_Validation, Main_Cohort_Table.[LearningSupport/RegularEnrolled], Count(Main_Cohort_Table.PIDM) AS CountOfPIDM, Count(Main_Cohort_Table.Graduate4Yrs) AS [CountOfGraduate 4 Yrs], Count(Main_Cohort_Table.Graduate5Yrs) AS [CountOfGraduate 5 Yrs], Count(Main_Cohort_Table.Graduate6Yrs) AS [CountOfGraduate 6 Yrs], Count(Main_Cohort_Table.GraduateCurrentYr) AS [CountOfGraduate Current Yr]
FROM Main_Cohort_Table INNER JOIN [Race Validation] ON Main_Cohort_Table.RACE = [Race Validation].RACE
GROUP BY Main_Cohort_Table.Banner, Main_Cohort_Table.GENDER, [Race Validation].RACE_Validation, Main_Cohort_Table.[LearningSupport/RegularEnrolled], [Race Validation].Race_Sort, Main_Cohort_Table.[LearningSupport/RegularEnrolled]
WHERE Main_Cohort_Table.Banner IN (#form.Cohorts#)
ORDER BY Main_Cohort_Table.Banner, Main_Cohort_Table.GENDER DESC , [Race Validation].Race_Sort, Main_Cohort_Table.[LearningSupport/RegularEnrolled] DESC;
/cfquery
The rest of the code is below.
head
meta http-equiv=Content-Type content=text/html; charset=utf-8 /
titleRPG_Data/title
/head
body
H1Retention, Progression, and Graduation (RPG) Rates/H1
cfform action=RPG_Data.cfm method=post name=RPG preservedata=yes target=self
!--List box (Select Fall Cohort)--
Fall IPEDS Cohorts (1999-08)
select name=Cohorts
option value=200808Fall 2008
option value=200708Fall 2007
option value=200608Fall 2006
option value=200508Fall 2005
option value=200408Fall 2004
option value=200308Fall 2003
option value=200208Fall 2002
option value=200108Fall 2001
option value=200008Fall 2000
option value=199908Fall 1999
/option
/select
!--Radio Buttons (Select RPG Rates)--
p
Select RPG Rates:br
input type=radio name=Rates value =Ret onSelect=document.enrl.submit()Retention Rates
input type=radio name=Rates value=ProgProgression Rates
input type=radio name=Rates value=GradGraduation Rates
/p
cfif IsDefined(form.Rates) is True
cfif form.Rates is Ret
!--List Box (Select Retention Rates Years)--
p
Select Retention Rates:
select name=Retention Rates
option value=Choose the Breakdown
option value=1st Year1st Year Retention Rates
option value=All YearsAll Retention Rates
/option
/select
/p/cfif
/cfif
cfif IsDefined(form.Rates) is True
cfif form.Rates is Prog
!--List Box (Select Progression Rates Years)--
p
Select Progression Rates:
select name=Progression Rates
option value=Choose the Breakdown
option value=1st Year1st Year Progression Rates
option value=All YearsAll Progression Rates
/option
/select
/p/cfif
/cfif
cfif IsDefined(form.Rates) is True
cfif form.Rates is Grad
!--List Box (Select Graduation Rates Years)--
p
Select Graduation Rates:
select name=Graduation Rates
option value=Choose the Breakdown
option value=Six YearSix Year Graduation Rates
option value=All YearsAll Graduation Rates
/option
/select
/p/cfif
/cfif
!--List Box (Select Gender)--
Display Cohorts by Gender:
select name=Gender
option value=MMale
option value=FFemale
option value=_Both
/option
/select
!--List Box (Select Race)--
Display Cohorts by Race:
select name=Race
option value=BBlack
option value=WWhite
option value=OOther
option value=UUnknown
option value=_All Races
/option
/select
!--Submit Button--
p
input type=Submit name=Submit value=Submit
/p
cfoutput query=RPGGradRates_Data
#qMain_Cohort_Table.Banner#br
/cfoutput
/cfform
/body
/html
|