I have a query that has, among other fields, name, sprg (short for subprogram), date, and a calculated field called InsJan. There will be 1 record for each name/sprg combination. If there’s only 1 sprg for a person, I don’t have a problem with InsJan. But if there’s more than 1 sprg for an person, InsJan is being calculated for each name/sprg record as if there was only 1 record for that name. Those dollars are being duplicated because they’re showing up on every record. I want all the records except the latest sprg record for a person to be 0 in InsJan.
Is there a way for my query to look at all the records for a person and for those records other than the last date, have 0 in InsJan? For the latest record for a person, InsJan would be calculated normally.
One thing I just thought of was to have 2 queries – 1 gives me the last sprg record for each person. All these would have 1 sprg for each person and I could calculate InsJan the way I’ve been doing it. The other query would give me all but the last sprg records for a person. Here, InsJan would always be zero.
If you have ideas on how to do any of that, as long as I get to my ultimate goal, I’d appreciate it.
Is there a way for my query to look at all the records for a person and for those records other than the last date, have 0 in InsJan? For the latest record for a person, InsJan would be calculated normally.
One thing I just thought of was to have 2 queries – 1 gives me the last sprg record for each person. All these would have 1 sprg for each person and I could calculate InsJan the way I’ve been doing it. The other query would give me all but the last sprg records for a person. Here, InsJan would always be zero.
If you have ideas on how to do any of that, as long as I get to my ultimate goal, I’d appreciate it.