Checkbox Forums

Help
+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    BonnieHellevig is offline Junior Member
    Join Date
    Mar 2008
    Posts
    22

    Default 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

  2. #2
    pwiesner is offline Administrator
    Join Date
    Mar 2007
    Posts
    385

    Default

    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.

  3. #3
    Zen
    Zen is offline Junior Member
    Join Date
    Oct 2009
    Posts
    1

    Default 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.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

SEO by vBSEO 3.5.0