N
NeoFax
I am having a problem ranking my data so that the rank resets when the
month changes. Here is what I would like to have:
Helo MonthOf SeqNo
14728 1 1
14729 1 2
14730 1 3
14731 2 1
14732 2 2
14733 2 3
14734 3 1
....
Here is the SQL statement, but it just ranks the info wrong:
SELECT tblPDPDates.HELO, (SELECT COUNT(*)
FROM tblPDPDates
WHERE [REC_START]=tblPDPDates.[REC_START])+1 AS seq_nbr,
Month([REC_START]) AS MonthOf
FROM tblPDPDates
WHERE (((tblPDPDates.STATION)="4fl") AND ((tblPDPDates.REC_START)
Between #1/1/2009# And #12/31/2009#))
GROUP BY tblPDPDates.HELO, Month([REC_START])
HAVING (((Month([REC_START])) Is Not Null))
ORDER BY tblPDPDates.HELO;
Any help would be appreciated. Thanks!
month changes. Here is what I would like to have:
Helo MonthOf SeqNo
14728 1 1
14729 1 2
14730 1 3
14731 2 1
14732 2 2
14733 2 3
14734 3 1
....
Here is the SQL statement, but it just ranks the info wrong:
SELECT tblPDPDates.HELO, (SELECT COUNT(*)
FROM tblPDPDates
WHERE [REC_START]=tblPDPDates.[REC_START])+1 AS seq_nbr,
Month([REC_START]) AS MonthOf
FROM tblPDPDates
WHERE (((tblPDPDates.STATION)="4fl") AND ((tblPDPDates.REC_START)
Between #1/1/2009# And #12/31/2009#))
GROUP BY tblPDPDates.HELO, Month([REC_START])
HAVING (((Month([REC_START])) Is Not Null))
ORDER BY tblPDPDates.HELO;
Any help would be appreciated. Thanks!