|Subject:||Re: Help with writing tcursor
|Date:||20 May 2020 20:27:46 -0400
|From:||"Kevin Zawicki" <firstname.lastname@example.org>
There are many ways to do this.
Use 2 tcursors.
Pseudo code , not tested. Add error checking, etc.
srcTC tcursor ;//source
fldVar = srcTC.”Month”
dstTC. setFieldValue(fldVar, srctTC.”Total”)
or you could scan the dst and locate each month while filtering on mainID,
look at cross tabbing,
Depends on the context an what might take longer.
Also, if possible and keyed, make MainID field a longInt.
Kevin Baker <email@example.com> wrote:
>If you look at the attached picture, I'm trying to update CT1.DB with
>the info from CT2.DB. I've been trying to do this with 12 different
>queries, which works somewhat. I get errors and some GPV, so was
>looking to see if this was possible by using a tcursor.
>I'm thinking if may require a tc.locate and not sure if doing a locate
>with a tc is recommended.
>Any help is very much appreciated.