lundi 20 juillet 2015

Concatenate Numbers in sqlite as text with a -

I am trying to concatenate numbers as text, with a dash (-) between the numbers I am concatenating.

I have figured out how to concatenate numbers as text:

CAST(variable1 AS VARCAHR) || CAST(variable2 AS VARCHAR)

I would like a dash between these, i.e.

CAST(variable1 AS VARCAHR) || CAST(- AS VARCHAR) || CAST(variable2 AS VARCHAR)

but this gives me an invalid SQL error. I think it might have something to do with the dash not being in unicode or something, I am not sure. Thank you for your help.

Aucun commentaire:

Enregistrer un commentaire