Ask a Question related to ASP Database, Design and Development.
-
Dave #1
Default Search for 2 field values return all results?
Hi. I have two fields that users can search for. Either room number or
Phone number. They can also put both a room number and a phone number and
search using both fields. However, this produces the default behavior of
returning all results if nothing is entered into either field. Here's what
the statement looks like.
fp_sQry="SELECT * FROM Results WHERE (Phone = ::Phone:: AND Room =
::Room::)"
fp_sDefault="Phone=[Phone]&Room=[Room]"
fp_sDataConn="fixittickets"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=5
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice="Name"
fp_sMenuValue="Name"
fp_iDisplayCols=5
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
(note first statement may wrap).
How can this be revised so that the default is to return No Reults until a
value for either phone or room (or both) are entered?
TIA!
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system ([url]http://www.grisoft.com[/url]).
Version: 6.0.552 / Virus Database: 344 - Release Date: 12/15/2003
Dave Guest
-
Date/Time field default values!
I'm creating a CF page that keeps track of dates/time of things. I have all my Date/Time fields set-up as Date/Time in access and I use... -
Sending search results to a results page..with asp
Please help.. very :confused; Ive setup 4 dynamic drop down boxes which populate themselves from my database, this all works fine..The last box... -
need to return results from dynamic quizes
Within the CDRom I'm creating each section is followed by a dynamic quiz. I would like to include a page at the end of the CD that the user can... -
DB2 Select - how to return a range of results
Hi, Here is some SQL from MS SQL 2000: select top 5 * from (select top 5 * from (select top 25 code, name, address from contacts where name... -
Return Search Results on the Same Page
I am new to ASP and would like to write a page with a drop down listbox on the top of the page. As soon as user choose a value in the dropdown,... -
Luis #2
Re: Default Search for 2 field values return all results?
first you need to do a return false on the onsubmit event of the form if
both fields are blank...
onsubmit="if(formname.phonefield.value=='' && formname.roomfield.value=='')
{alert('Please fill in at least a field before submitting');return false;}
else return true;"
then you might want to modify the query depending on the parameters (phone
only, room only or both)
qry = "SELECT * FROM RESULTS WHERE "
if request.form("phonefield")<>"" then qry = qry & " PHONE=" &
request.form("phonefield")
if request.form("roomfield") <>"" then
if request.form("phonefield")<> "" then qry = qry & " AND "
qry = qry & " ROOM=" & request.form("roomfield")
end if
"Dave" <spam@that> wrote in message
news:%23jsVk1$wDHA.2568@TK2MSFTNGP09.phx.gbl...what> Hi. I have two fields that users can search for. Either room number or
> Phone number. They can also put both a room number and a phone number and
> search using both fields. However, this produces the default behavior of
> returning all results if nothing is entered into either field. Here's> the statement looks like.
>
> fp_sQry="SELECT * FROM Results WHERE (Phone = ::Phone:: AND Room =
> ::Room::)"
> fp_sDefault="Phone=[Phone]&Room=[Room]"
> fp_sDataConn="fixittickets"
> fp_iMaxRecords=256
> fp_iCommandType=1
> fp_iPageSize=5
> fp_fTableFormat=True
> fp_fMenuFormat=False
> fp_sMenuChoice="Name"
> fp_sMenuValue="Name"
> fp_iDisplayCols=5
> fp_fCustomQuery=False
> BOTID=0
> fp_iRegion=BOTID
>
> (note first statement may wrap).
>
> How can this be revised so that the default is to return No Reults until a
> value for either phone or room (or both) are entered?
>
> TIA!
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system ([url]http://www.grisoft.com[/url]).
> Version: 6.0.552 / Virus Database: 344 - Release Date: 12/15/2003
>
>
Luis Guest



Reply With Quote

