The dash you are referring to would be the dash between Year and Monthyear & "-" & monthIf you want to remove it so that the values of year and moth run together:year & monthIF you want to use a different character in place of the dash:year & "/" & monthPut whatever character you want in place of the / in the above example.
I followed your suggestion, I remove the two quotation ( " "), the dash (-) and (&) symbol because I want them to run together, but it didn't work. can you please suggest a different way to do it. Thank you.
When you did that what result did you get? "didn't work" doesn't give me much to go on...
I deleted all the records, then removed the quotation, the dash and the one & symbol from the function. if i will create a new record it gives me 1401001, if I will create again a new record it will give me same 1401001. if you can download and play with the file. I will appreciate it. thank you so much.
I will decline that offer.
It would seem that the change does remove the dash, however. But the results suggest that the rest of the calculation now fails to return the expected result.
for your suggestions. i will try again to play. hoping some members will also help me to get the result what I want.
You might want to explain what this part of the expression is supposed to do:Case(month ≠ lastMonth or Right ( lastId ; digit ) = 10^digit -1; Right ( 10^digit ; digit-1 ) & "1";SerialIncrement ( Right ( lastId ; digit ) ; 1 )
The no. of digit that will increment by 1 every beginning of each month. yymm###(1401001,1401002,1401003....) thank you.
Please do not use this value as a primary key to link a record in this table to records in other tables. A simple auto-entered serial number is much safer to use for that purpose.
Since the calculation uses GetNthRecord, it will only compute correctly if all records are always in your found set at the time that the record is created or that the value is assigned (if you use a script).
I use a different method for getting the incremental part of this number series:
Define a self join relationship:
YourTable::Year = YourTable|SameYear::Year
This requires that you have a Year field that auto-enters: Year ( Get ( CurrentDate ) )
And another field, Sequence, is then defined to auto-enter or a script assigns:
Max ( YourTable|SameYear::Sequence ) + 1
Then this calculation becomes:
Let ( [ T = Get ( CurrentDate ) ;
Y = Right ( Year ( T ; 2 ) ;
M = Right ( "0" & Month ( T ) ; 2 )
T & M & Right ( "00" & Sequence ; 4 )
That calculation seems a bit simpler. You should also set this up as an auto-enter calculation with a unique values validation to make sure that two users creating records at the same time don't accidentally produce a record where this field has a duplicate value.
I got it.