+ Reply to Thread
Results 1 to 3 of 3
Thread: Need help with sql query
-
08-14-2008 06:13 PM #1
Junior Member
- Join Date
- Mar 2008
- Posts
- 22
Need help with sql query
I would love some assistance with a sql query against the checkbox database.
What I am trying to do is output a report via the backend database of all the active survey names and the text of their questions, and the question type.
I am going nuts trying to figure this out and it seems to me that someone else may already have one or more queries that would work.
The following Query will give me the QuestionIDs and the Survey Names, but getting the question text is eluding me.
SELECT app_survey.ckbx_Item.ItemID, app_survey.ckbx_Item.ItemTypeID, app_survey.ckbx_ItemType.ItemName,
app_survey.ckbx_ItemType_Categories.CategoryName, app_survey.ckbx_FormsAndFoldersView.ItemName AS SurveyName,
app_survey.ckbx_FormsAndFoldersView.IsActive, app_survey.ckbx_FormsAndFoldersView.ResponseCount,
app_survey.ckbx_FormsAndFoldersView.Owner, app_survey.ckbx_FormsAndFoldersView.DateCreated,
app_survey.ckbx_Template_Items.TemplateID AS SurveyID
FROM app_survey.ckbx_Item INNER JOIN
app_survey.ckbx_ItemType ON app_survey.ckbx_Item.ItemTypeID = app_survey.ckbx_ItemType.ItemTypeID INNER JOIN
app_survey.ckbx_ItemType_Categories ON app_survey.ckbx_ItemType.CategoryID = app_survey.ckbx_ItemType_Categories.CategoryID INNER JOIN
app_survey.ckbx_Template_Items ON app_survey.ckbx_Item.ItemID = app_survey.ckbx_Template_Items.ItemID INNER JOIN
app_survey.ckbx_FormsAndFoldersView ON app_survey.ckbx_Template_Items.TemplateID = app_survey.ckbx_FormsAndFoldersView.ItemID
WHERE (app_survey.ckbx_ItemType.CategoryID = 1000) AND (app_survey.ckbx_FormsAndFoldersView.ItemType = 'Form') AND
(app_survey.ckbx_FormsAndFoldersView.IsActive = 1)
Thank you for your time and assistance,
Bonnie
-
08-18-2008 03:56 PM #2
Administrator
- Join Date
- Mar 2007
- Posts
- 385
Unfortunately I can only provide detailed development support to users who own the development kit. That being said I would look in the ckbx_Text table.
-
10-12-2009 03:27 PM #3
Junior Member
- Join Date
- Oct 2009
- Posts
- 1
response to Bonnie
INNER JOIN
app_survey.ckbx_FormsAndFoldersView ON app_survey.ckbx_Template_Items.TemplateID = app_survey.ckbx_FormsAndFoldersView.ItemID
Are you sure about xxxxx.TemplateID=xxxxx.ItemID? it might be a good place to check.


LinkBack URL
About LinkBacks
Reply With Quote

