Does anyone know how do I make this work?
I need a search field to search for Ages (between x and y).
I found a few threads about this subject but I couldn't make it work.
I have the $Age field working fine but I can't seem to get the search box working.
This is the code I'm using in the db.cgi file:
if ($in{'Age-gt'}) {
my ($sec, $min, $hour, $day, $mon, $year, $dweek, $dyear, $daylight) = localtime(time());
my $byear = $year - $in{'Age-gt'} + 1900;
++$day;
++$mon;
($day < 10) and ($day = "0$day");
($mon < 10) and ($mon = "0$mon");
$date = $byear . $mon . $day;
$in{'BirthDate-lt'} = &get_computed_date($date);
}
if ($in{'Age-lt'}) {
my ($sec, $min, $hour, $day, $mon, $year, $dweek, $dyear, $daylight) = localtime(time());
my $byear = $year - $in{'Age-lt'} + 1899;
++$mon;
($day < 10) and ($day = "0$day");
($mon < 10) and ($mon = "0$mon");
$date = $byear . $mon . $day;
$in{'BirthDate-gt'} = &get_computed_date($date);
}
and this is the code I'm using in the html.pl:
<TR><TD><$font>Age: </FONT></TD><TD> between
<INPUT TYPE="TEXT" NAME="Age-gt" VALUE="$rec{'Age-gt'}" SIZE="2" MAXLENGTH="2"> and
<INPUT TYPE="TEXT" NAME="Age-lt" VALUE="$rec{'Age-lt'}" SIZE="2" MAXLENGTH="2"></TD></TR>
I my .cfg file I've set the Birthdate field using the Universal Date MOD, this is working fine, it give me the right age ($Age) no problem, but I can't get the search function to work. When I try to search I get the "No matching records" message.
What does Age-lt and Age-gt means and how does it work?
Any help would be greatly appreciated.
Thanks!
I need a search field to search for Ages (between x and y).
I found a few threads about this subject but I couldn't make it work.
I have the $Age field working fine but I can't seem to get the search box working.
This is the code I'm using in the db.cgi file:
if ($in{'Age-gt'}) {
my ($sec, $min, $hour, $day, $mon, $year, $dweek, $dyear, $daylight) = localtime(time());
my $byear = $year - $in{'Age-gt'} + 1900;
++$day;
++$mon;
($day < 10) and ($day = "0$day");
($mon < 10) and ($mon = "0$mon");
$date = $byear . $mon . $day;
$in{'BirthDate-lt'} = &get_computed_date($date);
}
if ($in{'Age-lt'}) {
my ($sec, $min, $hour, $day, $mon, $year, $dweek, $dyear, $daylight) = localtime(time());
my $byear = $year - $in{'Age-lt'} + 1899;
++$mon;
($day < 10) and ($day = "0$day");
($mon < 10) and ($mon = "0$mon");
$date = $byear . $mon . $day;
$in{'BirthDate-gt'} = &get_computed_date($date);
}
and this is the code I'm using in the html.pl:
<TR><TD><$font>Age: </FONT></TD><TD> between
<INPUT TYPE="TEXT" NAME="Age-gt" VALUE="$rec{'Age-gt'}" SIZE="2" MAXLENGTH="2"> and
<INPUT TYPE="TEXT" NAME="Age-lt" VALUE="$rec{'Age-lt'}" SIZE="2" MAXLENGTH="2"></TD></TR>
I my .cfg file I've set the Birthdate field using the Universal Date MOD, this is working fine, it give me the right age ($Age) no problem, but I can't get the search function to work. When I try to search I get the "No matching records" message.
What does Age-lt and Age-gt means and how does it work?
Any help would be greatly appreciated.
Thanks!