tmestamp resolution problem (rounding off to a day)

2005-07-29 Thread Nick Sinclair
Hi All, I seem to be having a problem with the resolution using the timestamp function. I am accessing the database snort on an ACID/SNORT/MySQL installation utilizing a collection of shell scripts that are run as cron jobs and function as a bot adding and removing firewall rules (iptables).

timestamp resolution problem (rounding off to a day)

2005-07-29 Thread Nick Sinclair
Hi All, I seem to be having a problem with the resolution using the timestamp function. I am accessing the database snort on an ACID/SNORT/MySQL installation utilizing a collection of shell scripts that are run as cron jobs and function as a bot adding and removing firewall rules (iptables).

Re: tmestamp resolution problem (rounding off to a day)

2005-07-29 Thread Jigal van Hemert
Nick Sinclair wrote: [.] WHERE date_format(timestamp, '%Y-%m-%d %T') =DATE_SUB(CURDATE(),INTERVAL $BLACKLIST_DECAY HOUR) * ...It only resolves to the DAY and not an hourly resolution. I have included a script below that I use for debugging, the MySQL functionality is taken directly from one

Re: tmestamp resolution problem (rounding off to a day)

2005-07-29 Thread Nick
Jigal van Hemert wrote: Nick Sinclair wrote: [.] WHERE date_format(timestamp, '%Y-%m-%d %T') =DATE_SUB(CURDATE(),INTERVAL $BLACKLIST_DECAY HOUR) * ...It only resolves to the DAY and not an hourly resolution. I have included a script below that I use for debugging, the MySQL functionality

rounding off

2003-11-22 Thread Mike Blezien
Hello, I need the ability to round off dollar amounts to the nearest 100th of a dollar amount, IE $14.9564 to $14.96 or $132.1123 to $113.11 can this be accomplished with MySQL SQL function ?? TIA -- MikemickaloBlezien =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Thunder Rain Internet Publishing

Re: rounding off

2003-11-22 Thread Paul DuBois
At 16:34 -0600 11/22/03, Mike Blezien wrote: Hello, I need the ability to round off dollar amounts to the nearest 100th of a dollar amount, IE $14.9564 to $14.96 or $132.1123 to $113.11 can this be accomplished with MySQL SQL function ?? Sounds like a job for TRUNCATE().

Re: rounding off

2003-11-22 Thread Mike Blezien
Thanks Paul. but I think the function I was looking for was ROUND(X,D), the TRUNCATE(X,D) just 'trims' it :) IE using the value 123.336 and I needed it to round off to 123.34 in this case. mysql select truncate(123.336,2); +-+ | truncate(123.336,2) |

Re: rounding off

2003-11-22 Thread Daniel Kiss
Hi! Use the round() function. round(14.9564, 2) = 14.96 round(32.1123, 2) = 113.11 Bye  Hello,  I need the ability to round off dollar amounts to the nearest 100th  of a dollar amount, IE $14.9564 to $14.96 or $132.1123 to $113.11  can this be accomplished with MySQL SQL function ?? --