Need to number a group of records( Focus_Group field/ Date ascending/ Tail is the value) SeqN should be 1,2,3,etc
This works in another database same sql!! All I get here is "1's"!
SELECT Defer_sorted.Focus_Group, Defer_sorted.Created_Date, Defer_sorted.Tail, (SELECT Count(*) FROM Defer_sorted as X
WHERE (((Defer_sorted.Focus_Group) Is Not Null))
and X.Focus_Group = Defer_sorted.Focus_Group
and X.Tail >= Defer_sorted.Tail
and X.Created_Date =Defer_sorted.Created_Date) AS SeqN
FROM Defer_sorted
ORDER BY Defer_sorted.Focus_Group, Defer_sorted.Created_Date;
Table Sample, "*" is the field seperator
Focus_Group *Created_Date *Tail *SeqN
ACARS *5/25/2015 *858 *1
ACARS *5/26/2015 *4053 *1
APU *5/26/2015 *951 *1
APU *5/26/2015 *4011 *1
APU *5/26/2015 *511 *1
APU *5/27/2015 *4276 *1
APU *5/27/2015 *245 *1
This works in another database same sql!! All I get here is "1's"!
SELECT Defer_sorted.Focus_Group, Defer_sorted.Created_Date, Defer_sorted.Tail, (SELECT Count(*) FROM Defer_sorted as X
WHERE (((Defer_sorted.Focus_Group) Is Not Null))
and X.Focus_Group = Defer_sorted.Focus_Group
and X.Tail >= Defer_sorted.Tail
and X.Created_Date =Defer_sorted.Created_Date) AS SeqN
FROM Defer_sorted
ORDER BY Defer_sorted.Focus_Group, Defer_sorted.Created_Date;
Table Sample, "*" is the field seperator
Focus_Group *Created_Date *Tail *SeqN
ACARS *5/25/2015 *858 *1
ACARS *5/26/2015 *4053 *1
APU *5/26/2015 *951 *1
APU *5/26/2015 *4011 *1
APU *5/26/2015 *511 *1
APU *5/27/2015 *4276 *1
APU *5/27/2015 *245 *1