OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

[Solved] Help with big invoice report!
Goto page Previous  1, 2
 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Base
View previous topic :: View next topic  
Author Message
eremmel
General User
General User


Joined: 29 Dec 2008
Posts: 17
Location: NL, Barneveld

PostPosted: Tue Mar 17, 2009 2:51 pm    Post subject: Reply with quote

In the query I see in the SELECT "S"."Client" if that has a relation to "Clients"."Clients", use it as well to keep your query performing.
When more data gets into the database (the effect might depend on the type of database).
You do not use any data from "Clients" in your SELECT and WHERE clause, so it does not make sense to have it in the FROM clause.
Just applying a "Clients"."Clients" = '<VALUE>' to the where clause does not make sense when you do not relate Clients to one of the other tables.

When you create a view you can define it with a Direct-SQL statement. A logical choice would be the first SELECT statement of the UNION ALL.
Assume you call the view "V_Client_Price". Your Query with UNION ALL will then start with (I skip the quotes)
Code:
SELECT V.Date, V.Client, V.Info, ..., V.Total
FROM V_Client_Price as V
UNION ALL
....


Now define another view "V_Big_Report", throw in the SQL statement with UNION ALL and use the view as if it was an table to create your report.
Apply the customer selection somehow in your report.
Back to top
View user's profile Send private message
Kurisuellegarden
General User
General User


Joined: 25 Feb 2009
Posts: 15

PostPosted: Wed Mar 18, 2009 9:13 am    Post subject: Reply with quote

Well, the Clients.Clients is all of their address information which is just one row of data in the table so it just adds the data of the selected Client information and payment terms to it and then the report does not put in repeated values so all the address info is filled out without me having to type it all. =\ It'd be hard to explain any further but don't worry about the extra clients, I have it working fine. Razz

Thanks for helping me so much guys! It's proved nerve wrecking for me to try and solve this by myself. =\ I'm completely new to sql and openoffice and I had to make this in a month. o_o So...yeah.

EDIT: Ahhhhh crap, just my luck



I have an error that will not let me do anything or change anything in my database now. =\

Also to point out, I did all the table views and the query worked fine and I was just about to go change the fields for the report and then BANG! This! Now I can't access anything in openoffice. =\ I'm so unlucky.
Back to top
View user's profile Send private message
Kurisuellegarden
General User
General User


Joined: 25 Feb 2009
Posts: 15

PostPosted: Fri Mar 20, 2009 10:37 am    Post subject: Reply with quote

I fixed the error. Somehow, the program shoved part of a query in between the lines and it... =\

But, I fixed it, made the query to view the final table view.

It worked.

After lots of work. It worked. Razz

Thanks guys, this has been one long trial just to get three querys on one report.

I don't know how i got that error but...I unzip the file, changed the file with UltraEdit, then I changed the error line, and inserted it back in by viewing the archive with 7zip and then just dropped the file in the viewer in the write folder. =]
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Base All times are GMT - 8 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group