in reply to SQL to obtain total SUM of a column and all entries between 2 dates
As for the primary question, look at the docs for Win32::ODBC. The ->Sql( SQL_STRING ) method Executes the SQL command SQL_STRING on the current connection. Returns ? on success, or an error number on failure. To get the data, you'll need to use the FetchRow method. This should help to get started and to see the structure returned:SELECT * FROM yourtable WHERE datcol BETWEEN '2005-01-25' AND '2005- +07-31'
my $rc = $DB->sql("SELECT SUM(Size_Byte) FROM Files_U WHERE Type ='doc +'"); die "ERROR: $rc" if $rc; use Data::Dumper; while( my $row = $DB->FetchRow ){ warn Dumper $row; }
|
|---|