Question : Using rtrim in my query

Hello guys,

I need to make a report where a text field is involved, but I need to filter only row where this field is not null. There are many rows with spaces in this field so Try to do something like this:

SELECT RTRIM(FIELD) AS DESCRIPTION FROM TABLE_X

But I have this error Argument data type text is invalid for argument 1 of rtrim function.
Ok, I understood but how can I work around?

Alexandre

Answer : Using rtrim in my query

Oops missing ) :

SELECT RTRIM(CAST(FIELD AS VARCHAR)) AS DESCRIPTION FROM TABLE_X

And with the Null criteria :

SELECT RTRIM(CAST(FIELD AS VARCHAR)) AS DESCRIPTION FROM TABLE_X
WHERE RTRIM(CAST(FIELD AS VARCHAR)) IS NOT NULL
Random Solutions  
 
programming4us programming4us