Cross Tab Query with DataSerial

P

Public

Hi,
I am trying to make a Cross Tab Query with PIVOT on Months of a field.
However, every month has its own evaluation. How could I incorporate the
separate evaluation for each month in Cross Tab Query?

Regards
 
K

KARL DEWEY

How could I incorporate the separate evaluation for each month in Cross Tab
Query?
I do not understand the question but if you will post your table structure -
name, field names with datatype, and sample data along with what you want as
a result of the query someone might be able to help.
 
P

Public

My sample Cross-Tab is something like (I am counting the number of completed
courses per month)

(1)
TRANSFORM Count(Courses.CourseID) AS CourseCount
SELECT Year([Courses].[CourseCompletionDate]) AS Expr1
FROM Courses
WHERE Year([Courses].[CourseCompletionDate]) = 2008
GROUP BY Year([Courses].[CourseCompletionDate])
PIVOT Month([Courses].[CourseCompletionDate]) In
("1","2","3","4","5","6","7","8","9","10","11","12");


However, if I want to count the In-Progress courses, I have to check each
month like the following (Here I am evaluating for Apr (month number 4)):

(2)
((Courses.[CourseBeginDate])<=DateSerial(2008,4,31)) AND
((Courses.CourseCompletionDate)>DateSerial(2008,4,31))

What I want is to combine number (2) with a query similar to number (1).
 

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