Gossamer Forum
Home : Products : DBMan SQL : Discussion :

Re: [donm] Query help?

Quote Reply
Re: [donm] Query help? In reply to
Hi,
You can write a simple function like below and put it into the global :
Code:
sub {
my $tags = shift;
if ($tags->{Member} eq 'No') {
my $today = GT::Date::date_get();
my $days_used = GT::Date::date_diff($today,$tag->{date_registered}) ;
return ($days_used < 30)?'Your account will expire in '.(30-$days_used).' days':'Your account has expired';
}
return;
}
I am not sure what value you put in your "date_exp" field but you can change "date_registered" field a little bit.

Also, you can do the same thing with SQL but I think using GT::Date is the best way in this case. Wink

Cheers,
jean@gossamer-threads.com

Last edited by:

jean: Nov 26, 2001, 4:39 PM
Subject Author Views Date
Thread Query help? donm 5149 Nov 26, 2001, 2:47 PM
Thread Re: [donm] Query help?
jean 5015 Nov 26, 2001, 4:36 PM
Thread Re: [jean] Query help?
donm 5021 Nov 26, 2001, 5:01 PM
Thread Re: [donm] Query help?
jean 5022 Nov 26, 2001, 5:54 PM
Thread Re: [jean] Query help?
donm 4989 Nov 26, 2001, 6:02 PM
Post Re: [donm] Query help?
donm 5002 Nov 28, 2001, 11:07 AM
Thread Re: [jean] Query help?
Reena0330 4755 Sep 10, 2002, 1:33 PM
Thread Re: [Reena0330] Query help?
jean 4747 Sep 10, 2002, 1:59 PM
Post Re: [jean] Query help?
Reena0330 4760 Sep 12, 2002, 11:10 AM
Post Re: [jean] Query help?
Reena0330 4801 Aug 15, 2002, 1:53 PM