Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How can I display my dates in a format that is currently not supported by BI/Query (i.e. YYYY-MM)?

0
Posted

How can I display my dates in a format that is currently not supported by BI/Query (i.e. YYYY-MM)?

0

Answer – First, you will need to create a calculated attribute with the data type set to char(n) … I used char(8) for the following example but you could use char(7). The syntax for this attribute would be: (ltrim(rtrim(str((datepart (Year, Customer.Starttime ))))+’-‘+ltrim(rtrim(str((datepart (Month, Customer.Starttime ))))))) Where Customer.Starttime would be your date attribute name. This will display the data in the format YYYY-MM. The above syntax can be modified for most date formats and it should also be noted that the functions Year and Month must be supported by your dbms.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123