Quarterly position change for this year only

K

KWhamill

So i need to create a query that gives me Quarterly position change for the
current year only, whatever the current year might be. and of course if we
aren't in that quarter yet it can just spit out zero. However, the computer
and i don't appear to be speaking the same language. if someone can give me a
foothold on this problem i'd really appreciate it.
 
K

KARL DEWEY

What is meant by 'Quarterly position change' for your query?

Is it fact that the location is different from past quarter?

Post sample data that the query would be comparing and show what you would
want as a result.
 
K

KWhamill

I'm sorry that's an oversight on my part but it's an excellent question.
I'm working with accounting data, by Position change i really mean change in
value so i have all of these daily changes in values that i need to sum by
quarter. So what i want is the quarterly change in value. what i have so far
is this:

SELECT fire_drv_positions.sv_index, fire_drv_positions.date,
Sum(fire_drv_positions.npv_change) AS Q1
FROM fire_drv_positions
GROUP BY fire_drv_positions.sv_index, fire_drv_positions.date
HAVING (((fire_drv_positions.date) Between "01/01/2008" And "3/31/2008"));

And what i want to do with this is first change the date criteria to always
pull this year regardless of what the year is and then do a Union to create
an entry for the other three quarters. or maybe there is a better way I don't
know but I am open to suggestions.
Thank you for asking
K
 
K

KARL DEWEY

You should not use date as a field names as it is a reserved word and may
cause problems.

Try this query ---
SELECT fire_drv_positions.sv_index, Format([ActDate],"yyyy q") AS Year_QTR,
Sum(fire_drv_positions.npv_change) AS Q1
FROM fire_drv_positions
WHERE (((fire_drv_positions.actdate) Between #1/1/2008# And #8/31/2008#))
GROUP BY fire_drv_positions.sv_index, Format([ActDate],"yyyy q");
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top