Grid - Selection criteria vs. Custom Sql?

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
leatherlips
Profound User
Posts: 83
Joined: Sun Oct 03, 2010 8:45 am
First Name: Mike
Last Name: Geldert
Company Name: Stonriver
Country: Angola
Contact:

Grid - Selection criteria vs. Custom Sql?

Post by leatherlips »

Whats the difference between these two properties as they pertain to a grid that you're binding to a database?
User avatar
David
Profound Logic Staff Member
Posts: 690
Joined: Fri Jan 04, 2008 12:11 pm
First Name: David
Last Name: Russo
Company Name: Profound Logic Software
Contact:

Re: Grid - Selection criteria vs. Custom Sql?

Post by David »

The "selection" criteria is used in conjunction with the "database file", "database fields", and "order by" properties to automatically generate an SQL query to fetch the data.

The generated query looks like this:

Code: Select all


SELECT ["database fields"] FROM ["database file"] WHERE ["selection criteria"] ORDER BY ["order by"]

So, "selection criteria" is used as the WHERE clause in the generated query. For example, let's say you wanted to select only those records where a field named "ACTIVE" in your file is equal to 'Y'. You would put this into the "selection criteria" property:

Code: Select all


ACTIVE = 'Y'

On the other hand...

The "custom sql" property is used INSTEAD of all the other properties. Using this property, you specify the entire SQL query yourself. You might use this to get a more complex query, such as one that joins multiple files.
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest