dbTalk Databases Forums  

Chart

comp.databases.ms-access comp.databases.ms-access


Discuss Chart in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
kevcar40
 
Posts: n/a

Default Chart - 05-13-2010 , 02:47 AM






Hi
i have created a chart based on a query

TRANSFORM Sum([Net ]) AS [SumOfNet] SELECT [Equip Code] FROM
[TblNet_potential joined area] GROUP BY [Equip Code] PIVOT
[weeknum];

this works fine puts weeknum in order ie 4 5 6 7 8 9

the question is when we move into another year how do i get the
weeknum to stay in weeknum order

ie 48 49 50 51 52 1 2

what i am getting is 1 2 48 49 50 51 52

Reply With Quote
  #2  
Old   
Michiel Rapati-Kekkonen
 
Posts: n/a

Default Re: Chart - 05-13-2010 , 03:01 AM






wouldn't something like
.... PIVOT [year], [weeknum]
do the job?

Michiel


"kevcar40" <kevcar40 (AT) btinternet (DOT) com> wrote

Quote:
Hi
i have created a chart based on a query

TRANSFORM Sum([Net ]) AS [SumOfNet] SELECT [Equip Code] FROM
[TblNet_potential joined area] GROUP BY [Equip Code] PIVOT
[weeknum];

this works fine puts weeknum in order ie 4 5 6 7 8 9

the question is when we move into another year how do i get the
weeknum to stay in weeknum order

ie 48 49 50 51 52 1 2

what i am getting is 1 2 48 49 50 51 52


--- news://freenews.netfront.net/ - complaints: news (AT) netfront (DOT) net ---

Reply With Quote
  #3  
Old   
kevcar40
 
Posts: n/a

Default Re: Chart - 05-13-2010 , 03:40 AM



On 13 May, 09:01, "Michiel Rapati-Kekkonen" <no-m... (AT) nonsense (DOT) zz>
wrote:
Quote:
wouldn't something like
... PIVOT [year], [weeknum]
do the job?

Michiel

"kevcar40" <kevca... (AT) btinternet (DOT) com> wrote in message

news:14915a56-e429-4ed7-bb44-cf5dbbbaff8a (AT) l28g2000yqd (DOT) googlegroups.com...





Hi
i have created a chart based on *a query

TRANSFORM Sum([Net ]) AS [SumOfNet] SELECT [Equip Code] FROM
[TblNet_potential joined area] * GROUP BY [Equip Code] PIVOT
[weeknum];

this works fine puts weeknum in order * ie * *4 *5 *6 * 7 *8 *9

the question is when we move into another year how do i get the
weeknum to stay in weeknum *order

ie *48 *49 *50 51 *52 * 1 * 2

what i am getting is * * 1 * *2 * *48 *49 *50 51 *52

--- news://freenews.netfront.net/ - complaints: n... (AT) netfront (DOT) net ---- Hide quoted text -

- Show quoted text -
i get syntax error when i put comma between fields

Reply With Quote
  #4  
Old   
Michiel Rapati-Kekkonen
 
Posts: n/a

Default Re: Chart - 05-13-2010 , 10:21 AM



nah, I don't know the right syntax, but what I wanted to point out is that
your query is obviously sorted on 'weeknum'
and that sorting on year and then on weeknum would give you the desired
result...


"kevcar40" <kevcar40 (AT) btinternet (DOT) com> wrote

On 13 May, 09:01, "Michiel Rapati-Kekkonen" <no-m... (AT) nonsense (DOT) zz>
wrote:
Quote:
wouldn't something like
... PIVOT [year], [weeknum]
do the job?

Michiel

"kevcar40" <kevca... (AT) btinternet (DOT) com> wrote in message

news:14915a56-e429-4ed7-bb44-cf5dbbbaff8a (AT) l28g2000yqd (DOT) googlegroups.com...





Hi
i have created a chart based on a query

TRANSFORM Sum([Net ]) AS [SumOfNet] SELECT [Equip Code] FROM
[TblNet_potential joined area] GROUP BY [Equip Code] PIVOT
[weeknum];

this works fine puts weeknum in order ie 4 5 6 7 8 9

the question is when we move into another year how do i get the
weeknum to stay in weeknum order

ie 48 49 50 51 52 1 2

what i am getting is 1 2 48 49 50 51 52

--- news://freenews.netfront.net/ - complaints: n... (AT) netfront (DOT) net ----
Hide quoted text -

- Show quoted text -
i get syntax error when i put comma between fields


--- news://freenews.netfront.net/ - complaints: news (AT) netfront (DOT) net ---

Reply With Quote
  #5  
Old   
Phil
 
Posts: n/a

Default Re: Chart - 05-14-2010 , 07:47 AM



On 13/05/2010 09:40:19, kevcar40 wrote:
Quote:
On 13 May, 09:01, "Michiel Rapati-Kekkonen" <no-m... (AT) nonsense (DOT) zz
wrote:
wouldn't something like
... PIVOT [year], [weeknum]
do the job?

Michiel

"kevcar40" <kevca... (AT) btinternet (DOT) com> wrote in message

news:14915a56-e429-4ed7-bb44-cf5dbbbaff8a (AT) l28g2000yqd (DOT) googlegroups.com...





Hi
i have created a chart based on *a query

TRANSFORM Sum([Net ]) AS [SumOfNet] SELECT [Equip Code] FROM
[TblNet_potential joined area] * GROUP BY [Equip Code] PIVOT
[weeknum];

this works fine puts weeknum in order * ie * *4 *5 *6 * 7
*8 *9

the question is when we move into another year how do i get the
weeknum to stay in weeknum *order

ie *48 *49 *50 51 *52 * 1 * 2

what i am getting is * * 1 * *2 * *48 *49 *50 51 *52

--- news://freenews.netfront.net/ - complaints: n... (AT) netfront (DOT) net ---- Hi
de quoted text -

- Show quoted text -

i get syntax error when i put comma between fields

Can't you add the year (DateText) and nomth so that you get "200950" "200951"
"200952" "201001" 201002" which should deal with your sort order
Then use Right(DateText,2) to extract the week no

Phil

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.