Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > ColdFusion > If criteria is ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 1653 of 1694
Post > Topic >>

If criteria is Null then show all.

by "valntyn via WebmasterKB.com" <u29706@[EMAIL PROTECTED] > Mar 5, 2007 at 06:15 PM

I have an .asp page that p***** four variables to another .asp page by
using
an HTML form.  A SQL query then runs against an Access database using
those
four variables.  The variables are: "cnty", "rte", "bgn", and "nd".

My current SQL statement is as follows:

SQL = "SELECT * FROM Construction WHERE County='" & cnty & "' AND Route='"
&
rte & "' AND Begin<=" & nd & " AND Ending>=" & bgn & ""  

This works just fine, but I would like to add the ability to make "nd" and
"bgn" Null (leave those fields blank on the HTML form), and then return
all
records that match the "cnty" and "rte" variables.  I have an SQL Query in
the Access database that does this perfectly but I'm having trouble
getting
the same functionality on the web.

Any help is greatly appreciated!

-- 
Message posted via WebmasterKB.com
http://www.webmasterkb.com/Uwe/Forums.aspx/coldfusion-general/200703/1
 




 1 Posts in Topic:
If criteria is Null then show all.
"valntyn via Webmast  2007-03-05 18:15:50 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu Jul 24 13:50:15 CDT 2008.