title: Wanted to unload redshift table data to S3 with appending date on the file name
body: <pre><code>UNLOAD ('SELECT * FROM cn.test') TO 's3://bucket/archive/stage/test-#{format(@scheduledStartTime,'YYYY-MM-dd-HH')}.csv' credentials 'aws_access_key_id=###;aws_secret_access_key=###' DELIMITER '|' ADDQUOTES PARALLEL OFF ALLOWOVERWRITE
  </code></pre>
  
  <p>I tried the above command to unload to S3. Getting error : Amazon Invalid operation: syntax error at or near "<code>YYYY</code>"; 1 statement failed.</p>
  
  <p>If i give escape character near to date, the file name is going like test-#<code>{format(@scheduledStartTime,'YYYY-MM-dd-HH')}.csv</code> instead of actual <code>sysdate</code>.</p>
  
  <p>Could anyone can help me</p>