Variables in SQL 'WHERE' clause

G

George M

I am trying to use the FP db results wizard custom SQL
feature to pass a variable as part of the where clause.

I am at a loss to find the correct syntax!

Any help, suggestions greatly appreciated.
 
T

Tiffany K. Edmonds

If you are using the custom SQL - you might want to check out this site:
http://www.w3schools.com/sql/sql_where.asp

If you are trying to do this in the standard wizard - if you haven't seen
this option already, click the More Options button in step 3 (I believe) and
then the Criteria button of the DRW.
 
G

George M

Exactly my point.

If you use More Options in Step 3, how do you enter a
variable in the value field?
 
M

MD WebsUnlimited.com

Hi George,

The double colon is used as the delimiter for form field names. For example
if I wish to replace the where clause in a SQL Statement then I would use.

Select * from mytable ::WhereClause::

Then in HTML, say a drop down selection box, I could have

<select name="WhereClause" >
<option value="" > All </option>
<option value="Where name = 'Mike'" >All Mikes<option>
<option value="Where zip like '515*' " > Zip codes starting with
515</option>
</select>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top