Upcoming database upgrades. Airtable functionality will be reduced for ~15 minutes at 06:00 UTC on Feb. 4 / 10:00 pm PT on Feb. 3. Learn more here

#ERROR! message when I try to use "Right({String},4)" when String = numerical result of a date based formula

Topic Labels: Formulas
270 2
Showing results for 
Search instead for 
Did you mean: 

I have created a random number generator string {RNGS} using this formula: VALUE(DATETIME_FORMAT(AddDate, ‘mm’)) # Autonumber # Autonumber.

(Note: I have purposefully substituted # for an asterisk/mutliply function in this post)

A sample result is 238425 (33 # 85 # 85). I’d like to use just the first 4 digits for my random number field

I’ve tried both RIGHT(VALUE(DATETIME_FORMAT(AddDate, ‘mm’)) # Autonumber # Autonumber,4)

Both of these generate the #ERROR! message. Please help!

2 Replies 2

Thinking this might be a data type issue since RIGHT requires a string. You can can convert values into strings by doing something like "" & {some field}. So you could do:

RIGHT( "" & {RNGS}, 4)

Genius! That worked.