On a second note,
If I have a text field with manually typed in: 1111-2222-3333-4444, how can I retrieve the numbers only, and without the dashes (Replacing the dashes with "" so that it pushes the numbers together.
Dynamically, I doubt it's possible, but cheap and cheerful:
define your CC field as normal, then define a calculation field, result text:
Left ( CC_raw ; 4 ) & "-" & Middle ( CC_raw ; 5 ; 4 ) & "-" & Middle ( CC_raw ; 9 ; 4 ) & "-" & Middle ( CC_raw ; 13 ; 4 )
although you'd probably want to have some kind of error check to ensure operator enters sixteen digits and only sixteen digits - unless it's AMEX...
retrieving CC_raw would still return a number
For the second part, it's a case of stripping out the "-", either by sampling only the digits, using a text string function, as above, or:
Substitute ( CC_withdashes; "-"; "" )
Filter ( CC_withdashes ; 1234567890 )
also works to strip out all characters except numeric digits. This may be a better option if there is any chance that the field may contain other characters that need to be filtered out. Otherwise, subsitute and this function produce identical results so take your pick.
and for the credit card numbers you could use a case function to adjust the dash format based on the card type field.