0 Replies Latest reply on May 12, 2009 4:03 AM by shaunperry

    Advanceddatagrid problem with SQLite













      I have been building an Flex application in Air. I have an internal SQLite database which has grouping on an advanceddatagrid, the following SQL works and displays the data in the grid (but not in the correct ordering)

      var sqlText:String = "
      SELECT masterdata.*, cats.catName 
      FROM masterdata 
      INNER JOIN cats ON masterdata.catId = cats.catId 
      WHERE masterdata.sectionTitle = '"+sectionTitle+"' AND masterdata.slideId = '"+slideId+"'";


      I ve updated the coding to the following to order the records:

      var sqlText:String = "
      SELECT DISTINCT(masterData.itemId), cats.catName, groups.groupName, masterData.catId, masterData.itemId, masterData.itemName, masterData.articleNumber, masterData.colourway, masterData.sectionTitle, masterData.slideId, 'Add' as cartItemButton 
      FROM masterData 
      INNER JOIN groups ON masterData.groupName = groups.groupName
      INNER JOIN cats ON masterdata.catId = cats.catId  
      WHERE masterData.sectionTitle = '"+sectionTitle+"' AND masterData.slideId = '"+slideId+"' 
      GROUP BY masterData.itemId, groups.groupName 
      ORDER BY masterRecordId ASC";

      I then get an error - Error: Find criteria must contain at least one sort field value. and the grouping or records dont appear. If I remove the DISTINCT and GROUP BY the grouping then works again.


      I don't know what I m missing here? Can anyone help? I ve been struggling for hours to work out what the issue is.