G
Guest
Hi guys,
I am trying to create a function and query that will increment my invoice #
field. The invoice # field unfortunately can contain alphabetic characters
in it. I have created a function that strips all the alph chars out of my
invoice # field. Then I have a query that gets the max number in the invoice
table. However, its not working correctly. I have for the numbers only, the
highest value is 2019, and the highest alpha-numeric value is FC 9.
The query I have created seems to return '9' as the maximum number in this
result, it should return 2019, meaning it still returns FC 9 as the maximum
invoice #..
This is the query I have built:
SELECT max(StripAlpha(nz(RefNumber,'')) as _RefNumber
from Invoice
where Len(RefNumber ) > 0
I have also tried creating a query that just strips the alpha from the
RefNumber, and tried to use a max query on that, it returned the same results
Any suggestions would be super.
thanks
I am trying to create a function and query that will increment my invoice #
field. The invoice # field unfortunately can contain alphabetic characters
in it. I have created a function that strips all the alph chars out of my
invoice # field. Then I have a query that gets the max number in the invoice
table. However, its not working correctly. I have for the numbers only, the
highest value is 2019, and the highest alpha-numeric value is FC 9.
The query I have created seems to return '9' as the maximum number in this
result, it should return 2019, meaning it still returns FC 9 as the maximum
invoice #..
This is the query I have built:
SELECT max(StripAlpha(nz(RefNumber,'')) as _RefNumber
from Invoice
where Len(RefNumber ) > 0
I have also tried creating a query that just strips the alpha from the
RefNumber, and tried to use a max query on that, it returned the same results
Any suggestions would be super.
thanks