Making Month columns out of Periods

ratbags21

Registered User.
Local time
Today, 21:29
Joined
Jun 28, 2007
Messages
10
I would be grateful if someone could assist me in this.
Our company has 52 accounting periods, one for each week of the year. I have to write a report, however, with "Month" columns. This is an example of a month:
October = Periods 1 to 4
November = Periods 5 to 8
December = Periods 9 to 13 etc

The data I have looks like this:

Company Doctype Docnum Period Year
-------- -------- ------- ------ -----
ANL PINH 1056 01 2008
ANL PINH 1062 03 2008
ANL PINH 1178 06 2008
ANL PINH 1189 07 2008
ANL PINH 1191 07 2008

The result in this case would show 2 in Month column "Oct" and
3 in Month coumn "Nov"
I am trying to create a query that can create a "month" column and count all the transactions from the constituent "Periods". Now, I can easily add a column called "Month" into the table, then write a bit of VBA to put the correct month value into each record. However, this is a bit of a pain & I'm sure it would be more elegant to do this via a query.
Please can someone suggest how I might do this.
Thanks a lot
 
You could set up a table that shows the relevant month for each period and join that in your query.
 
Thanks Neil,
That works just fine. Well, at least it worked on dummy data 'cos unbeknownst to me, the Period coumn had a trailing space(!!) so
the join did not work. I ran an update query to get rid of it and
we are now rockin n rollin :)
 

Users who are viewing this thread

Back
Top Bottom