473,445 Members | 1,904 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Horizontal grouping

Hi

I need to "group" figures by month. I only need the totals for each month so
detail is not required. My problem is that I need the months to appear
horizontally and each month's figure underneath it. Here is the example;

Jan Feb Mar ...... Dec
£2345.00 £1626.00 £9484.00 £23939.00

How can I achieve this?

Thanks

Regards
Dec 7 '05 #1
8 2414
Have you tried the crosstab wizard under the new Query tab.

"John" <Jo**@nospam.infovis.co.uk> wrote in message
news:O8****************@TK2MSFTNGP14.phx.gbl...
Hi

I need to "group" figures by month. I only need the totals for each month
so detail is not required. My problem is that I need the months to appear
horizontally and each month's figure underneath it. Here is the example;

Jan Feb Mar ...... Dec
£2345.00 £1626.00 £9484.00 £23939.00

How can I achieve this?

Thanks

Regards

Dec 7 '05 #2
John wrote:
Hi

I need to "group" figures by month. I only need the totals for each month so
detail is not required. My problem is that I need the months to appear
horizontally and each month's figure underneath it. Here is the example;

Jan Feb Mar ...... Dec
£2345.00 £1626.00 £9484.00 £23939.00

How can I achieve this?

Thanks


select case
when Total > 100 Then Total
else
''
end as [January],
case
when [Condition 2] Then Total
else
''
end as [February],
case
when [Condition 3] Then Total
else
''
end as [March]
from MyTable

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200512/1
Dec 7 '05 #3
Wow, it news for me that you can case within a select statement.

Regards
"Adam Turner via AccessMonster.com" <u14766@uwe> wrote in message
news:587f89dedb6cc@uwe...
John wrote:
Hi

I need to "group" figures by month. I only need the totals for each month
so
detail is not required. My problem is that I need the months to appear
horizontally and each month's figure underneath it. Here is the example;

Jan Feb Mar ...... Dec
£2345.00 £1626.00 £9484.00 £23939.00

How can I achieve this?

Thanks


select case
when Total > 100 Then Total
else
''
end as [January],
case
when [Condition 2] Then Total
else
''
end as [February],
case
when [Condition 3] Then Total
else
''
end as [March]
from MyTable

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200512/1

Dec 8 '05 #4
You can create this with a multi-column layout.

--
Duane Hookom
MS Access MVP
--

"John" <Jo**@nospam.infovis.co.uk> wrote in message
news:O8****************@TK2MSFTNGP14.phx.gbl...
Hi

I need to "group" figures by month. I only need the totals for each month
so detail is not required. My problem is that I need the months to appear
horizontally and each month's figure underneath it. Here is the example;

Jan Feb Mar ...... Dec
£2345.00 £1626.00 £9484.00 £23939.00

How can I achieve this?

Thanks

Regards

Dec 8 '05 #5
John wrote:
Wow, it news for me that you can case within a select statement.

Regards
Hi

[quoted text clipped - 26 lines]
end as [March]
from MyTable


Sure...actually I just recently discovered this approach myself as I had a
very similar, almost identical, scenario.

It should work fine for you.

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200512/1
Dec 8 '05 #6

"Adam Turner via AccessMonster.com" <u14766@uwe> wrote in message
news:587f89dedb6cc@uwe...
John wrote:
Hi

I need to "group" figures by month. I only need the totals for each month sodetail is not required. My problem is that I need the months to appear
horizontally and each month's figure underneath it. Here is the example;

Jan Feb Mar ...... Dec
£2345.00 £1626.00 £9484.00 £23939.00

How can I achieve this?

Thanks


select case
when Total > 100 Then Total
else
''
end as [January],
case
when [Condition 2] Then Total
else
''
end as [February],
case
when [Condition 3] Then Total
else
''
end as [March]
from MyTable

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200512/1


Please pardon my confusion. This works with Jet SQL?
Dec 8 '05 #7
crosstab query

Dec 8 '05 #8
Adam Turner via AccessMonster.com wrote:
Sure...actually I just recently discovered this approach myself as I had a
very similar, almost identical, scenario.

It should work fine for you.


The case statement is a (wonderful) ANSI 92 and later construct that is
supported by Oracle, and, I believe, MS SQL. However, I believe you may
have ANSI 92 enabled. This is found under options->Tables/Queries->SQL
COmpatible Syntax (ANSI 92) in the bottom right hand corner.

Otherwise, your solution will not work, as far as I can tell.

I'm not sure what effect the ANSI 92 compatibility has on Jet
performance or whatever. I work mainly in Oracle, so maybe someone else
can comment.

As an aside, When I first started with A2003 last year, I tried
switching to ANSI 92 compaitibility once but Jet SQL still demanded the
cumbersome ANSI join syntax and not the very much easier and older join
syntax of Oracle (called a Theta type join), so I switched back. The
theta joins make it so deliciously easy to write dynamic SQL with VBA code.
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
Dec 8 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: amber | last post by:
Hello, I have a report in VB.NET/Crystal Reports. I have a criteria form that users select between 2 different types of grouping (group by category or group by year). Can I programmatically...
2
by: Andreas Håkansson | last post by:
Seeing how my previous post seem to have fallen between the cracks, I thought I would have a second, more direct, go at it. So my question is "Is it possible to group (Muenchian method) over...
3
by: ahaque38 | last post by:
Hello. Using A2K SP3, I am having the following problem with a report using "Sorting and Grouping". I have recently added a grouping in the reports for "Category2<>'CONTRACTS'". I have...
8
by: Mike MacSween | last post by:
tblCourses one to many to tblEvents. A course may have an intro workshop (a type of event), a mid course workshop, a final exam. Or any combination. Or something different in the future. At...
6
by: shapper | last post by:
Hello, I have 20 inputs in a web page and I would like to add a 200px gray horizontal line as a separator every 5 inputs to divide the form into sections. What is the best way to do this? ...
0
by: Corey | last post by:
hello, I’m trying to run a query and I’m getting error messages Can anyone help me get though this problem? 1: Tried this and got this error message ORA-00923 , decode...
3
by: j0rd4n | last post by:
I have a user control that needs to allow vertical scrolling but not horizontal scrolling. In the user control's resize event, I need to adjust the size of all the children controls. For this to...
0
by: Roman Bertle | last post by:
Hello, I try to format monetary values using the locale module, python2.5: Python 2.5.2a0 (r251:54863, Jan 3 2008, 17:59:56) on linux2 Type "help", "copyright", "credits" or "license" for...
1
by: Sandeep Singh | last post by:
Hi, How to do group by in XSLT ? I tried on the following codes: <files> <file name="swablr.eps" size="4313" project="mars"/> <file name="batboy.wks" size="424" ...
7
by: milestogofromhere | last post by:
It is late so this is probably something really obvious but I am not seeing it. Can someone please help? Here is the page in question: html - http://www.itsyourplate.com/index2.php css -...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.