Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


On Wed, 2012-01-04 at 10:39 -0700, Jeff Sadowski wrote:
    This is all confusing to me. How many tables are in this database
and what are they? What are the fields and to what table to they belong?
What are the field types of each one of the fields? What do you mean by
ip and serial are character arrays? Character arrays are not one of the
field types nor field properties that I know of. An example of character
arrays would be nice too.
    You use the terms office 1 name, office 2 name, office 1 subtotal,
and office 2 subtotal. What are the relationships of these terms to the
fields in the database?
    What I'm trying to do is to create your database to see what could
be done. But I can't do that with what you have written: I need more
specific information.
    You speak of a script. Could you share that with us also?

--Dan

You are 100% correct here is a better example of data and what I'd
like as the output form with the given example.


CREATE TABLE `storename` (
   `store` int(11) NOT NULL,
   `storename` varchar(20) DEFAULT NULL,
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

INSERT INTO `storename` VALUES (1,"store 1");
INSERT INTO `storename` VALUES (2,"store 2");

CREATE TABLE `printusage` (
  `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE
CURRENT_TIMESTAMP,
  `serial` varchar(20) NOT NULL,
  `ip` varchar(15) DEFAULT NULL,
  `counter` bigint(20) DEFAULT NULL,
  `webcounter` bigint(20) DEFAULT NULL,
  `totalprint` bigint(20) DEFAULT NULL,
  `bwprint` bigint(20) DEFAULT NULL,
  `copies` bigint(20) DEFAULT NULL,
  `bwcopies` bigint(20) DEFAULT NULL,
  `faxes` bigint(20) DEFAULT NULL,
  `store` int(11) DEFAULT NULL,
  PRIMARY KEY (`date`,`serial`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

INSERT INTO `printusage` VALUES ('2011-12-30
00:00:00','1','192.168.1.50',100,100,100,100,0,0,0,1);
INSERT INTO `printusage` VALUES ('2011-12-30
00:00:00','2','192.168.1.51',100,100,100,100,0,0,0,1);
INSERT INTO `printusage` VALUES ('2011-12-30
00:00:00','3','192.168.1.52',100,100,100,100,0,0,0,1);
INSERT INTO `printusage` VALUES ('2011-12-30
00:00:00','4','192.168.2.50',100,100,100,100,0,0,0,2);
INSERT INTO `printusage` VALUES ('2011-12-30
00:00:00','5','192.168.2.51',100,100,100,100,0,0,0,2);
INSERT INTO `printusage` VALUES ('2011-12-31
00:00:00','1','192.168.1.50',105,105,105,105,0,0,0,1);
INSERT INTO `printusage` VALUES ('2011-12-31
00:00:00','2','192.168.1.51',105,105,105,105,0,0,0,1);
INSERT INTO `printusage` VALUES ('2011-12-31
00:00:00','3','192.168.1.52',105,105,105,105,0,0,0,1);
INSERT INTO `printusage` VALUES ('2011-12-31
00:00:00','4','192.168.2.50',105,105,105,105,0,0,0,2);
INSERT INTO `printusage` VALUES ('2011-12-31
00:00:00','5','192.168.2.51',105,105,105,105,0,0,0,2);

example of desired output report.

store 1
IP, Serial, Counter Difference from 2011-12-30 00:00:00 to 2011-12-31 00:00:00
192.168.1.50, 1, 5
192.168.1.51, 2, 5
192.168.1.52, 3, 5
store 1 subtotal 15
store 2
IP, Serial, Counter Difference from 2011-12-30 00:00:00 to 2011-12-31 00:00:00
192.168.2.50, 4, 5
192.168.2.51, 4, 5
store 2 subtotal 10
total 25

       This looks to be quite feasible. Reports can be created two ways
in Base: using the Report Wizard, and using Design View (Create Report
using Design View). The latter uses what was originally the Sun Report
Builder.
     Here is a couple of links that might be of use when creating
reports in design view: 
http://www.google.com/search?client=ubuntu&channel=fs&q=sunreportbuilderguidebook.pdf&ie=utf-8&oe=utf-8
is a link to a PDF describing how to use the report builder.
http://user.services.openoffice.org/en/forum/viewtopic.php?f=47&t=39095
is a link to describe how to create user defined functions. (You may not
need this for you problem, but it may come in handy later.
     LibreOffice Base uses HSQLDB. Presently, Base 3.4.4 uses version
1.8. Version 2.2.6 is available as a separate program. The following
link will begin the download of the HSQLDB Guide for version 1.8.
http://hsqldb.org/doc/guide/guide.pdf

--Dan


-- 
For unsubscribe instructions e-mail to: users+help@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.