2

I have a table with 6 columns (Integer) containing licence numbers.

I would like to label the data using only the columns containing a licence number and not have a label for the columns containing a 0 (zero) attribute.

The column PRIMARY_LICENCE_NUMBER contains only licence numbers but the other columns have a mixture of licence numbers and a zero, reducing until License_6 has no licence numbers and only zeros. The largest licence number is 118001 and the smallest is 11001.

I want to label in this order: PRIMARY_LICENCE_NUMBER,License_2,License_3,License_4,License_5,License_6

I have read your other answers with expressions containing Left$ and Int and have not had any luck working out an expression that works.

My bumbling attempt is at this stage:

"L1: "+PRIMARY_LICENCE_NUMBER+Chr$(13)+"L2: "+Left$(License_2, Len(License_2)*Int(License_2<>0))

and all variations in between, and I can't figure out how to fix this issue.

1

If your License_n fields are integers:

"L1: "
+PRIMARY_LICENCE_NUMBER
+Chr$(13)
+"L2: "
+Left$(Str$(License_2), Len(Str$(License_2))*Int(License_2>0))

or better:

"L1: "
+PRIMARY_LICENCE_NUMBER
+Chr$(13)
+Left$(Str$("L2: "+License_2), Len(Str$("L2: "+License_2))*Int(License_2>0))

(prefix L2: does not need to be visible if there is no license number)

... and you can continue with this pattern.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.