Postgres 9.5 import to MSSQL Server 2012 r2 verification issue
This is more readable and may perform better:

SELECT date_part('year', month) as year,
       date_part('month', month) as month,
       count(*) as "trandate sum"
FROM (
  SELECT date_trunc('month', to_date(trandate, CASE
             WHEN left(trandate, 4) = '2014' THEN 'YYYY-MM-DD' ELSE 'MM/DD/YYYY' END
                    ))::date as month
  FROM SomeSchema.transaction_detail
  ) td
GROUP BY month
ORDER BY 1, 2


Note that you could install PgAdminIII in your windows desktop, and use its pg_dump (in C:\Program Files\PostgreSQL\9.3\bin), or start the console from PgAdmin (menu Plugins/PSQL Console). Depending on the type of data you're trying to import, a CSV format export file could be a good alternative. Otherwise, an SQL file via pg_dump with individual INSERT statements and processed via MSSQL's osql.exe or sqlcmd.exe tools to run it.