Gossamer Forum
Home : Products : DBMan : Customization :

Greater than and Equal to search

Quote Reply
Greater than and Equal to search
How ??

Quote Reply
Re: Greater than and Equal to search In reply to
Set your search term to one less than you want to search for.

If you want to search for "greater than or equal to" 4 set your "greater than" search to 3.

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Greater than and Equal to search In reply to
Thanks for your reply. I kinda figured that out but I don't think my client's customers will. They are going to search for specific gems (diamonds, etc.) within a certain price range and a certain weight range. They're most likely going to want to search by their minimum weight (eg. 1.5 carats) and a maximum weight of (eg. 3 carats). I really can't rely on them to put > 1.49 and < 3.01.

Any way to fake the code? or maybe an OnClick() javascript?

Thanks!
Pete

Quote Reply
Re: Greater than and Equal to search In reply to
I gave a short answer to a short question. Smile

You can alter sub query. Something like:

Code:

if ($in{'Carat-gt'}) { $in{'Carat-gt'} = $in{'Carat-gt} - .01; }
if ($in{'Carat-lt'}) { $in{'Carat-lt'} = $in{'Carat-lt} + .01; }


This would go just after

local (%sortby);

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Greater than and Equal to search In reply to
Thanks!

You're Awesome maaaan

<Grateful>Pete</Grateful>

Just finished adding all the javascript to the html.pl.
Your way is MUUUUch easier

Quote Reply
Doesn't work like this. In reply to
my ($i, $column, @search_fields, @search_gt_fields, @search_lt_fields, $maxhits, $numhits, $nh,
$field, @regexp, $line, @values, $key_match, @hits, @sortedhits, $next_url, $next_hit, $prev_hit,
$first, $last, $upper, $lower, $left, $right, $restricted);
local (%sortby);

if ($in{'Carat-gt'}) {
$in{'Carat-gt'} = $in{'Carat-gt} - .01; }

if ($in{'Carat-lt'}) {
$in{'Carat-lt'} = $in{'Carat-lt} + .01; }


Quote Reply
Re: Doesn't work like this. In reply to
I'm sorry. I left out some quotation marks

Code:

if ($in{'Carat-gt'}) { $in{'Carat-gt'} = $in{'Carat-gt'} - .01; }
if ($in{'Carat-lt'}) {$in{'Carat-lt'} = $in{'Carat-lt'} + .01; }
Of course, this is assuming that you have a field called Carat in your .cfg file and fields called Carat-gt and Carat-lt on your search form.

JPD
http://www.jpdeni.com/dbman/