Telling Snowflake that a certain text value contains in fact, a date

You can change a text value containing a date very easily using the [format] argument of date functions like TO_DATE( ) in Snowflake.

See below for an example.

SQL
--Using the format argument of date functions in Snowflake
select 
    'Thu, 1 Aug 2024 11:23:28 GMT' as datum_origineel,
    -- to_date(datum_origineel) as datum -- This will throw an error.
    to_date(datum_origineel, 'DY, DD MON YYYY HH24:MI:SS TZD') as datum -- Using the format argument of the to_date() function you will be able to tell Snowflake that the text value in the 1st argument is in fact a date. 
where to_timestamp_ltz(datum_origineel, 'DY, DD MON YYYY HH24:MI:SS TZD') < '2024-08-02'
;
SQL