summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-05-14 06:35:17 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-05-14 06:35:17 +0000
commit97b27be79b3513a3c533d5d6462d38e23c1fba3c (patch)
treedd7cf7c5367bf5d2f4be131da4d0170f7910f919
parent24c70e444b6c8017ce240e5ad6f1cae8368cc240 (diff)
Another performance patch
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1183 4979c152-3d1c-0410-bac9-87ea11338e46
-rw-r--r--LedgerSMB/Form.pm6
1 files changed, 4 insertions, 2 deletions
diff --git a/LedgerSMB/Form.pm b/LedgerSMB/Form.pm
index 6eba7223..13f2f34a 100644
--- a/LedgerSMB/Form.pm
+++ b/LedgerSMB/Form.pm
@@ -2152,8 +2152,10 @@ sub all_years {
# get years
my $query = qq|
- SELECT (SELECT MIN(transdate) FROM acc_trans),
- (SELECT MAX(transdate) FROM acc_trans)|;
+ SELECT (SELECT transdate FROM acc_trans ORDER BY transdate asc
+ LIMIT 1),
+ (SELECT transdate FROM acc_trans ORDER BY transdate desc
+ LIMIT 1)|;
my ( $startdate, $enddate ) = $dbh->selectrow_array($query);