Skip to content

Instantly share code, notes, and snippets.

@kevincdurand1
Created May 20, 2018 18:53
Show Gist options
  • Select an option

  • Save kevincdurand1/0b2799b4957fe86314873c7e9a44464c to your computer and use it in GitHub Desktop.

Select an option

Save kevincdurand1/0b2799b4957fe86314873c7e9a44464c to your computer and use it in GitHub Desktop.
Percent Change.Sql
SELECT [DateTime],[Close]
,([Close] - LAG ([Close],1) OVER (ORDER BY [DateTime]))/LAG ([Close],1) OVER (ORDER BY [DateTime])*100 AS PCT_CHANGE_CLOSE
FROM [dbsec].[dbo].[EURUSDM1FiboMA];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment