All Forums UDA
marcmc 112 posts Joined 12/05
06 Oct 2009
A bit of mathermatics

Hi.I have a formula to calculate a unique transaction sequence number that works as follows:transaction sequence(TS) * 100 + record sequence(RS)So take two examples:118(TS) * 100 + 103(RS) = 1190399(TS) * 100 + 50 = 9950From the results I need to be able to get back to determine the original TS and RS.The solution has to work for both examples above.So in the case of 11903 I need to get back to 118 and 103 and in the case of 9950 I need to get to 99 and 50.Any help thouroughly appreciated.

pawan0608 101 posts Joined 12/07
06 Oct 2009

I don't think, it would be possible because no. of digits in RS is varying and the key point is it could be more then 2

marcmc 112 posts Joined 12/05
06 Oct 2009

Thanks Pawan - exactly what I was thinking. Oh well it wasn't critical anyway, I have an alternative just not a mathematical one.

marcmc 112 posts Joined 12/05
21 Oct 2009

FYI I think this algorithm will work apart from the first examples where the TS and RQ cross over which gives me another option:seq_id / 100 as TS;seq_id mod 100 as RS;

You must sign in to leave a comment.