Linked Questions

Popular Questions

Convert finance period into Date/Time

Asked by At

I am trying to convert finance period into datetime e.g. 201801 = 01/04/2018

e.g.;
201801 = 01/04/2018
201802 = 01/05/2018
201803 = 01/06/2018
201804 = 01/07/2018
201805 = 01/08/2018
201806 = 01/09/2018
201807 = 01/10/2018
201808 = 01/11/2018
201809 = 01/12/2018
201810 = 01/01/2019
201811 = 01/02/2019
201812 = 01/03/2019

Formula in tableau that works 
DATE(left(str([Period]),4) + "-" + right(str([Period]),2) + "-1")

I need it in SQL. tried using convert and Cast but keep getting syntax errors.

CONVERT(date,(left(GL_master.period,4)+ '-' +(right(GL_master.period,2)+ 
'-1')),

As per summary.

Related Questions