PDA

View Full Version : Cheque # sequence checking


ABC123

Dave Mac Callum
01-23-2005, 04:29 AM
Focus Information Systems 23rd Jan 2005.

Ref mydocuments\alpha5v5


Have this problem in my Cash-Book Report.

Require to detect missing or duplicate Transact Number sequences

Idea is to detect previous value of TRANSACT; Add 1 to it; Compare result against Current TRANSACT Value

Table is Cash-Book (attatched)
Report is Cheque Sequence Report
Calculated field
Previous Transact (Cheque#) Prev_seq Works ok
Add 1 to Previous Transact Calc_xsact Works ok
Convert to Char string Calc_Xsact_Char Works ok
Pad left with 0 Calc_Xsact_Char+pad X

I assume that the system does not tolerate padl on a calculated field.

Is there any way to left-zero-fill a calculated value ?

Or alternatively, is there a way to remove the left-zero-fill chars from Transact field ?

Can anyone help ?

Regards

Dave Mac

Bill Warner
01-23-2005, 08:40 AM
""Is there any way to left-zero-fill a calculated value ?
""

Yes, if you make PADL part of the calc expression, and if the expression evaluates to a character field.

For example:

PADL(EXPRESSION,5,"0")

Will take a character EXPRESSION (which could be a calculated value), and add as many zeros as necessary to make it a total of 5 characters long. If it's already that long, it will leave it alone.

Dave Mac Callum
01-23-2005, 07:35 PM
Focus Information Systems 24th Jan 2005.

Ref mydocuments\alpha5v5\Cheque book…


Hi there Bill.

Thanks for your reply.

As far as I can see my Calculated expression conforms to what you suggest.

padl("calc-"Calc_Xsact_Char",6,"0")

When I build this calculated field it evaluates to Type “C”, but it does not give me a valid Result. The result if “calc-"”. Does this tell me anything ?

Looking forward.

Regards

Dave Mac