Hey guys,
I have a client where we created a Practice Entity and a Staff Entity. There are multiple Staff records associated to a Practice. So I wrote a view that shows the relationship and I use that view for the Practice Search Screen. The client wants to be able to search for the Practice by name, city, state of practice and first, last name of staff. However they just want to return distinct records of the Practice. So if a particular Practice has 5 staff records associated it with when they search for that practice they want to bring back just 1 record, not 5.
I thought I would be able to use the SelectSql property of the ListBlock to do this, but no luck. All the examples show that you can set the SelectSql to something like 'SELECT * FROM Company' so I thought I could limit the results by setting it to 'SELECT DISTINCT prac_name, prac_city, prac_state... FROM vwPracticeStaff' but when the container gets executed it throws a sql error. The error in the logs just shows the WHERE clause and no SELECT clause so it appears that i have to use 'SELECT *' or it doesn't like it.
Does anyone have any idea if this is possible as far as returning distinct records? Thanks :-)