| View previous topic :: View next topic |
| Author |
Message |
giladwal Newbie

Joined: 06 Jan 2008 Posts: 4
|
Posted: Sun Jan 06, 2008 9:41 am Post subject: Problem with functions |
|
|
Hi All,
I tried to write query with count(Some_Field) function, and I got this erro:
"Statement to complex. Only Count(*) is supported."
Does anyone familiar with this problem?
Thanks |
|
| Back to top |
|
 |
frazelle09 OOo Enthusiast


Joined: 24 May 2004 Posts: 142 Location: Mexicali, Baja California
|
Posted: Sun Jan 06, 2008 10:55 am Post subject: |
|
|
Giladwal - Welcome to the OOoForum.org forum! We are glad to have you on board and hope we will be able to help you with your issues!
i think the error message
Only Count(*)
means that all you can put in the column is the asterisk * symbol to represent all values. At this point you cannot use anything else.
If i'm wrong on this, someone please correct me.
Have a great day and welcome aboard again!  _________________ Now using 3.2.1 on 4 PCLinuxOS 2010 boxes (two are laptops).
"The earth is one country and mankind its citizens."
Bahá'u'lláh
"La tierra es un sólo país y la humanidad sus ciudadanos."
Bahá'u'lláh |
|
| Back to top |
|
 |
giladwal Newbie

Joined: 06 Jan 2008 Posts: 4
|
Posted: Sun Jan 06, 2008 11:03 am Post subject: |
|
|
Hi frazelle09,
Thanks for your reply.
You're absolutely rught -> I can't do anything else.
SO - How can I enable this function? should I download anything new?
I have strong background with MS access, but no backround at all on the OpenOffice tool, so I'll be glad for any help.
Have a great day,
Gilad |
|
| Back to top |
|
 |
Sliderule Super User


Joined: 29 May 2004 Posts: 2476 Location: 3rd Rock From The Sun
|
Posted: Sun Jan 06, 2008 11:56 am Post subject: |
|
|
Gilad:
With the use of the COUNT function . . . that is an "Aggregate" function ( just like MIN, MAX, SUM , AVG, VAR_POP, VAR_SAMP, STDDEV_POP, STDDEV_SAMP ).
As a result . . . you NEED to include the GROUP portion . . . that is . . . to tell the Query that you want to Group the results based on which other Field(s) ( column ). If, you are using the Query GUI ( Graphic User Interface ) . . . that is from . . . Create Query in Design View... then . . . on the Function line . . . choose the Field(s) to 'Group' by . . . and . . . choose the Function(s) ( Average, Count, Maximum, Minimum, Sum ) that you need.
Just as an FYI ( For Your Information ) . . . if you were to 'write' the SQL directly, it might look like this: | Code: | SELECT
"DATE" as "DATE",
COUNT( "YOUR_FIELD" ) as "Count"
FROM "YOUR_TABLE_NAME" AS "YOUR_TABLE_NAME"
GROUP BY "DATE" |
I hope this helps, please be sure to let me / us know.
Sliderule
Thanks to add [Solved] in your first post title (edit button) if your issue has been fixed / resolved. |
|
| Back to top |
|
 |
giladwal Newbie

Joined: 06 Jan 2008 Posts: 4
|
Posted: Sun Jan 06, 2008 1:02 pm Post subject: |
|
|
Hey,
I am aware of the use in the group feature, but it seems my OpenOffice has some problems - When I want to choose function, like you said, the function combo box is empty end disabled.
Are you familiar with such problems?
Thanks for your fast reply!
Its late in my country - If you'll reply me I'll see it tommorow.
Good night/ |
|
| Back to top |
|
 |
Sliderule Super User


Joined: 29 May 2004 Posts: 2476 Location: 3rd Rock From The Sun
|
Posted: Sun Jan 06, 2008 1:15 pm Post subject: |
|
|
Gilad:
First . . . choose a Field in the Field line. . . afterwards . . . you can select a Function . . . whether . . . - Average
- Count
- Maximum
- Minimum
- Sum
- Group
For additional columns . . . you can select another Aggregate Function . . . OR . . . Group clause.
I am using OpenOffice Version 2.3.1 on a Windows machine. Which version of OpenOffice and which operating system are you using?
Additionally, please check out the links below . . . with examples and explicit instructions on creating Queries while using GROUP.I hope this helps, please be sure to let me / us know.
Sliderule
Thanks to add [Solved] in your first post title (edit button) if your issue has been fixed / resolved. |
|
| Back to top |
|
 |
giladwal Newbie

Joined: 06 Jan 2008 Posts: 4
|
Posted: Mon Jan 07, 2008 12:03 am Post subject: |
|
|
Hi,
I have no functions availble even when I'm select field.
I'm using version 2.3.1 on windows XP.
I didn't install all the pakage - Just Base, Cala, Math and Java Run Time.
Thanks,
Gilad |
|
| Back to top |
|
 |
Sliderule Super User


Joined: 29 May 2004 Posts: 2476 Location: 3rd Rock From The Sun
|
Posted: Mon Jan 07, 2008 8:10 am Post subject: |
|
|
Gilad:
You said: | Gilad wrote: | | I didn't install all the pakage - Just Base, Cala, Math and Java Run Time. |
I have no idea . . . but . . . I would recommend that you install the complete OpenOffice application . . . I think you can just rerun the install.
I hope this helps, please be sure to let me / us know.
Sliderule
Thanks to add [Solved] in your first post title (edit button) if your issue has been fixed / resolved. |
|
| Back to top |
|
 |
|