Gossamer Forum
Home : Products : DBMan : Customization :

Or search

Quote Reply
Or search
Hi - This is driving me crazy. Anyway to do an OR search? For example, I need to call up all records that have a specific date in the date field OR a specific day in the day field.

TIA!
Quote Reply
Re: [msavi] Or search In reply to
When you say you need to "call up" do you mean you are using a link to get those reords?

Or are you using a search form?

Please explain. Did you by any chance check the DBMan FAQ under the section "Search" to see if you could find a solution?

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] Or search In reply to
Hi -

I am pasting two section of code:

1.


print qq|
<form action="$db_script_url" method="GET" name="form1">
<input type=hidden name="db" value="$db_setup">
<input type=hidden name="uid" value="$db_uid">
<input type=hidden name="sb" value="8">
<input type=hidden name="so" value="descend">
|;
#&html_record_form();
#&html_search_options;
print qq|
<p><center>
<INPUT TYPE="SUBMIT" NAME="view_records" VALUE="Get appointments">&nbsp;
<INPUT TYPE="Text" Name="Date">
</p></form>
|;

This just gives me a text box. I enter a data and it gives me all the records with that date. If the date is a Monday I need it to give me all records that have the day field as Monday.

2.


print qq|<META HTTP-EQUIV="Refresh" CONTENT="0; URL=$db_script_link_url&view_records=1&Date=$date&sb=8&so=descend&ww=1"><BR>\n|;

This is in my html_home. It gives me a list of all records with today's date. Together with this I need everything with today's DAY.

I have the code to get today's day - but can not do a OR search.

TIA
Quote Reply
Re: [msavi] Or search In reply to
 1) you can use something like this which will pull in all the available entries from the database for fields: Month, Day, Year.
I'm not sure how your fields are setup? Are they all select fields?

If you just want to show all values for these fields instead of:
|; print &build_select_field_from_db

use:
|; print &build_select_field

print qq|
<form action="$db_script_url" method="GET" name="form1">
<input type=hidden name="db" value="$db_setup">
<input type=hidden name="uid" value="$db_uid">
<input type=hidden name="sb" value="8">
<input type=hidden name="so" value="descend">

<CENTER><TABLE border=0 cellpadding=2 cellspacing=0 width=300>
<TR><TD><$font>Month:</font></TD><TD> |; print &build_select_field_from_db("Month",$rec{'Month'}); print qq|</TD></TR>
<TR><TD><$font>Day:</font></TD><TD>\$ |; print &build_select_field_from_db("Day",$rec{'Day'}); print qq|</TD></TR>
<TR><TD><$font>Year:</font></TD><TD>|; print &build_select_field_from_db("Year",$rec{'Year'}); print qq|</TD></TR>
<TR align=center><td colspan=2><INPUT TYPE="SUBMIT" NAME="view_records" VALUE=" Get appointments "></TD></TR></TABLE></CENTER>
</FORM>


2) Check out the followiing thread:

Select dates from menu; then search by date -- DBMan FAQ title
=====================================

Subject More date help needed !!!
fkman 27-Mar-01
Thread: http://gossamer-threads.com/p/134702

kellner's response may provide the easy solution for your link url, it reads:

Response: kellner

This may come a little late, but -
I don't understand why you added the fields for day, month and year.
I came across your posting trying to do something similar: a lecture database with lectures in the future. It has a
date field with the format "24-07-2001". [Note: dbman's standard format is "24-Mar-2001", if you want to use my
format, you have to change the subroutines get_date and date_to_unix in db.pl.]

First I get today's date:
$today = &get_date(time());

Then I simply call the future lectures with the following link:

<a href="$db_script_link_url&uid=default&view_records=1&date=>$today">view future lectures</a>

That's it. If you want to have events in between today and some specific date in the future, you could adapt the "What's new mod". I haven't tried this, though.

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] Or search In reply to
Hi -

Thanks for your help. This still does not solve my problem. This is an AND statement that will search for each field together.

I insert a date into a text box and then click. I get everything with that date. I need to get everything with the DAY of that date (even though the date is different) at the same time.

TIA