Sorting Records

  • Thread starter Thread starter Margaret
  • Start date Start date
M

Margaret

I have a report that has a field dept with a field major
and cy field. Example:

dept major CY
10 28 1,300
10 33 2,000
15 16 700
15 24 776
15 33 800

I want to sort my records so that I have a dept line and
the cy would be broken into two colums ... one column with
a major under 30 and one column with a major over 30.
Example:

dept cy >30 cy<30
10 1300 2000
15 1476 800 (the 1476 is 700 and 776 added)

How would I go about doing this?
 
Margaret said:
I have a report that has a field dept with a field major
and cy field. Example:

dept major CY
10 28 1,300
10 33 2,000
15 16 700
15 24 776
15 33 800

I want to sort my records so that I have a dept line and
the cy would be broken into two colums ... one column with
a major under 30 and one column with a major over 30.
Example:

dept cy >30 cy<30
10 1300 2000
15 1476 800 (the 1476 is 700 and 776 added)


Once you've determined what a report should display, the
next thing you should do is design a query that organizes
the data appropriately. In this case, I think you want the
report's record source query to be something like:

SELECT dept,
Sum(IIf(major > 30, CY, 0)),
Sum(IIf(major < 30, CY, 0))
FROM table
GROUP BY dept
 
Back
Top