Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Additional line in date-global

Quote Reply
Additional line in date-global
Hi to all,

i am using this global to view a SUM of data-records with a special value in colun "Ausgabe":
sub {
my $cond = new GT::SQL::Condition;
my ($total) = $DB->table('Links')->select(['SUM(Wert)'],$cond)->fetchrow_array;
local $_ = int $total;
1 while
return "$_";

The using is:
1. I define the "Ausgabe" from the actual date and
2. put this Ausgabe (format: mm-yyyy) into global like this:

<%set Ausgabe = GT::Date::date_transform($date, '%dd%.%mm%.%yyyy%', '%mm%-%yyyy%')%>

Now what i need is this:
When the actual "Ausgabe" is not in db (e.g. 02-2005), then the global search for the last available date, in this case: 01-2005.
Perhaps: IF $total = 0 ...... etc ....... ???

How can i do that?

Thanks in advance!

Subject Author Views Date
Thread Additional line in date-global Coyu 1199 Feb 3, 2005, 8:02 PM
Post Re: [Coyu] Additional line in date-global
afinlr 1133 Feb 4, 2005, 5:34 AM