LiveGrid Forms - SelectSql with WHERE clause

2009-04-19
2012-12-11
  • Brock Alston
    Brock Alston
    2009-04-19

    I am trying to include a where clause and I get mySQL database errors.

    Does SelectSql support WHERE clause for "SL" elements?

    Thx!

     
    • xavier6666
      xavier6666
      2009-05-21

      WHERE works but how can we get the WHERE clause to refer a field value of the current row?

       
    • Matt Brown
      Matt Brown
      2009-05-22

      Here is what I sent Brock in a private email:

      Here's an example from one of my apps:

      memTE.CurrentField("SelectSql")="select %aliasmain%UserId,coalesce(%alias%DisplayName,%aliasmain%UserId) from " & UserTab & " order by 2"

      %alias% means the column name belongs to the table in this select statement (UserTab above). %aliasmain% is required because "UserId" exists in the both the main table and in UserTab. By specifying %aliasmain%, it tells Rico that I want to display the UserId column in the main table.

      Hope this helps,

      Matt