Gossamer Forum
Home : Products : DBMan SQL : Discussion :

Re: [jean] Query help?

Quote Reply
Re: [jean] Query help? In reply to
Hi Jean,

I'm looking for a similar # of days print out...except that the formula for the # of days is calculated based on the 'casestatus' field.

-if 'casestatus' == 'Open'

days_open = 'creationdate' - todays_date

-if 'casestatus' == 'Closed

days_open = 'creationdate' - 'closeddate'



I made a few modifications to your sub and this is what I came up with:

Code:


sub {
my $tags = shift;
if ($tags->{casestatus} eq 'Open') {
my $today = GT::Date::date_get();
my $days_used = GT::Date::date_diff($today,$tag->{creationdate}) ;
return $value->{$days_used};

}
if ($tags->{casestatus} eq 'Closed') {
my $days_used = GT::Date::date_diff($tag->{closeddate},$tag->{creationdate});
return $value->{$days_used};

}
return;
}


Only thing is that this code gives me errors:

Stack Trace
======================================
Dbsql (6357): Dbsql::Home::__ANON__ called at /auto/cweb0/www-home/virtual/wwwin-gsbu/cgi/seg/dbman_SQL/admin/GT/Template.pm line 759 with arguments
(HASH(0x5e6214)).
Dbsql (6357): GT::Template::_get_var called at /auto/cweb0/www-home/virtual/wwwin-gsbu/cgi/seg/dbman_SQL/admin/templates/default/compiled/search_results.html.compiled line 343 with arguments
(GT::Template=HASH(0x597368), get_days_open, 0, 1).
Dbsql (6357): GT::Template::__ANON__ called at /auto/cweb0/www-home/virtual/wwwin-gsbu/cgi/seg/dbman_SQL/admin/GT/Template.pm line 539 with arguments
(GT::Template=HASH(0x597368)).
Dbsql (6357): GT::Template::_parse called at /auto/cweb0/www-home/virtual/wwwin-gsbu/cgi/seg/dbman_SQL/admin/GT/Template.pm line 89 with arguments
(GT::Template=HASH(0x597368), search_results.html, HASH(0x5ccb2c)).
Dbsql (6357): GT::Template::parse called at /auto/cweb0/www-home/virtual/wwwin-gsbu/cgi/seg/dbman_SQL/admin/Dbsql/Home.pm line 116 with arguments
(GT::Template, search_results.html, HASH(0x5e5498), HASH(0x5ccb2c)).
Dbsql (6357): Dbsql::Home::print called at /auto/cweb0/www-home/virtual/wwwin-gsbu/cgi/seg/dbman_SQL/admin/Dbsql/Home.pm line 76 with arguments
(Dbsql::Home=HASH(0xb4fec), search_results.html, HASH(0x5e5498)).
Dbsql (6357): Dbsql::Home::process called at /cweb0/www-home/virtual/wwwin-gsbu/cgi/seg/dbman_SQL/db.cgi line 29 with arguments
(Dbsql::Home=HASH(0xb4fec), in, GT::CGI=HASH(0x54e45c), sql, GT::SQL=HASH(0x56e1ac), cfg, Dbsql::Config=HASH(0x231ca4)).
Dbsql (6357): main::main called at /cweb0/www-home/virtual/wwwin-gsbu/cgi/seg/dbman_SQL/db.cgi line 22 with no arguments.



What changes do I need to make to the sub? Also, how do debug subs based on the error messages..I don't really understand where I would start debugging or where the error is. Thanks
Reena
Subject Author Views Date
Thread Query help? donm 5200 Nov 26, 2001, 2:47 PM
Thread Re: [donm] Query help?
jean 5064 Nov 26, 2001, 4:36 PM
Thread Re: [jean] Query help?
donm 5070 Nov 26, 2001, 5:01 PM
Thread Re: [donm] Query help?
jean 5071 Nov 26, 2001, 5:54 PM
Thread Re: [jean] Query help?
donm 5038 Nov 26, 2001, 6:02 PM
Post Re: [donm] Query help?
donm 5052 Nov 28, 2001, 11:07 AM
Thread Re: [jean] Query help?
Reena0330 4804 Sep 10, 2002, 1:33 PM
Thread Re: [Reena0330] Query help?
jean 4796 Sep 10, 2002, 1:59 PM
Post Re: [jean] Query help?
Reena0330 4809 Sep 12, 2002, 11:10 AM
Post Re: [jean] Query help?
Reena0330 4851 Aug 15, 2002, 1:53 PM