Q: How can I extract the year information from the date field in an SQL database datasource?

A: You can use the following query expression: DISTINCT(DATEPART(yy,DatasetName.FieldName)) as Fld_Year, where DatasetName is the name of the dataset, FieldName is the name of the field, Fld_Year is the alias of the field for years. For the file datasource, please use the following expression: DISTINCT(Year(DatasetName.FieldName)) as Fld_Year. 

08 July,2019
Tags: iDesktop

More iDesktop FAQ