Help on a type of view

Blastbeats

Registered User.
Local time
Yesterday, 21:57
Joined
Feb 22, 2012
Messages
17
Hello again everyone,
I have a table that has this kind of fields, expense type, expense description, jan, feb, mar, apr, etc etc, the month fields showing the amount spent on each month, i need to take this view to a list kinda, and show the month value only, aka showing this with a new column saying the month and breaking down the expense amount for it, to make my question clearer ill make a little example:

type description jan feb mar apr

type 1 expense 1 $150 $200 $180 $120

i need to move this to this kind of view

description month amount

expense 1 january $150
expense 1 february $200
expense 1 march $180
expense 1 april $120

is there a type of query or something i could base myself on to reach this view? thanks in advance.
 
Try a UNION query:

SELECT Description, "January" As TheMonth, Jan
FROM TableName
UNION ALL
SELECT Description, "February" As TheMonth, Feb
FROM TableName
...
 
genious, thanks a million worked perfectly
 
No problem. A UNION query is a common way to work around a non-normalized design. ;)
 

Users who are viewing this thread

Back
Top Bottom