i need to cast from varchar(100) to bigint that way:

```
select max(cast(referencia_factura as bigint))from ventas;

```

but i get a syntax error. ¿how can i solve it?
I need to get the maximum value of the "referencia\_factura" field but I need to cast it to bigint.