Casting int YYYYMMDD to date produces incorrect value in Squirrel-SQL
For integer to date conversion you may consider using the system function in msdb called dbo.agent_datetime(date int, time int).  This will automatically convert to a datetime (which you could then cast as a date).

Source: https://blog.sqlauthority.com/2015/03/13/sql-server-interesting-function-agent_datetime/