UDA

Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

10-06-2009
06:20 AM

10-06-2009
06:20 AM

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) = 11903

99(TS) * 100 + 50 = 9950

From 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.

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) = 11903

99(TS) * 100 + 50 = 9950

From 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.

3 REPLIES 3

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

10-06-2009
06:31 AM

10-06-2009
06:31 AM

Re: A bit of mathermatics

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

10-06-2009
06:58 AM

10-06-2009
06:58 AM

Re: A bit of mathermatics

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

10-21-2009
08:04 AM

10-21-2009
08:04 AM

Re: A bit of mathermatics

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;

seq_id / 100 as TS;

seq_id mod 100 as RS;