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

Repeat entries in base query.

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Base
View previous topic :: View next topic  
Author Message
eland
General User
General User


Joined: 07 May 2006
Posts: 5

PostPosted: Sun Oct 08, 2006 6:15 pm    Post subject: Repeat entries in base query. Reply with quote

I'm querying a base database and dropping the query into calc to analyse the results.

Sometimes I want one of the individual query results to appear twice in the calc sheet.

However if I duplicate a criteion entry when making a query using design view the results still only appears once.

Does anyone know of a clever way around this problem??

TIA.
Back to top
View user's profile Send private message
DrewJensen
Super User
Super User


Joined: 06 Jul 2005
Posts: 2616
Location: Cumberland, MD

PostPosted: Mon Oct 09, 2006 11:15 am    Post subject: Reply with quote

I'm not sure I follow totally.

Do you just want the same date repeated in multiple columns?

If that is it, then simply double click on the column name more then once. Each time you do so the column will be added to the result set with a slightly different alias name.

Let's say you have a column in the table named "Val". The first time it is added to the result set it is named "Val", the second time it is named "Val1", the third time "Val2" and so on.

Now - if that is not what ou want but rather you want values from a tables column returned in seperate columns in the result set, and each of these column have some different criterian then you will need to use more then one query and join them together.

If that is what you are looking for let me know and I can show you an example.

Drew
Back to top
View user's profile Send private message Send e-mail Visit poster's website
eland
General User
General User


Joined: 07 May 2006
Posts: 5

PostPosted: Tue Oct 10, 2006 11:09 am    Post subject: Reply with quote

Hi Drew,
I thought I was making a bit of a dog's dinner of my question Smile.

So perhaps an example.

I'm running a sports league and I need to record the points scored by a team's opponents throughout the season.(Teams don't play everyone so we do a crude strength of schedule adjustment).

Say Team A has played Team B and Team C,then querying the total points scored by teams B and C is easy(even for me).

But say Team A then plays Team B again.

if I have a query with Team B,Team C and Team B(again) when I chuck the query into a calc spreadsheet Team B's numbers only appears once.

I want something like.

Team.....Points scored
Team B......40
Team C......36
Team B......40

but I get

Team B.....40
Team C.....36

I'm currently just cutting and pasting Team B's numbers and tacking them onto the bottom of the column,but as teams play more repeats it's easy to miss one.

Great job BTW.

Eland.
Back to top
View user's profile Send private message
DrewJensen
Super User
Super User


Joined: 06 Jul 2005
Posts: 2616
Location: Cumberland, MD

PostPosted: Tue Oct 10, 2006 2:52 pm    Post subject: Reply with quote

alright, well this would the point where it would help to see the actual Base table strucures you are building the query against.

Depending on how those tables look will dictate the query - now that is a redundant statement if ever there was one.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Base All times are GMT - 8 Hours
Page 1 of 1

 
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