How to change date format to ddmmyyyy in Report builder
Hello All,
Please could you help me with one of the client requirements I have to convert the date column date format from mmddyyyy to ddmmyyyy. I have built a report using report builder and I have extracted the report data to an excel sheet, however, the Update Time field in the excel sheet has the date format mmddyyyy however, I need ddmmyyyy format. Below is the query. Please can you let me know how can I do this.
SELECT DISTINCT T2.PROJECT_NAME,
T3.REFERENCE_ID AS REFERENCE_ID1,
T3.NAME AS URL1_title,
T3.URL AS URL1,
T2.REFERENCE_ID,
T2.NAME AS URL2_title,
T2.URL AS URL2,
T4_1.LITERAL_NAME AS LITERAL_NAME,
T2.TAGS,
T2.REQUEST_STATE AS REQUEST_STATE1,
T1.REQUEST_STATE,
T1.REC_DATETIME,
T1.DAYS_IN_STATE,
T1.PREV_REQUEST_STATE
FROM RIDW.VW_REQUEST_STATE_HISTORY T1
INNER JOIN RIDW.VW_REQUEST T2
ON (T2.REQUEST_ID = T1.REQUEST_ID)
INNER JOIN RIDW.VW_REQUEST_RELATIONAL_LINK LT1
ON (T2.REQUEST_ID = LT1.REQUEST1_ID) AND LT1.ISSOFTDELETED = 0 AND LT1.NAME = 'com.ibm.team.workitem.linktype.trackedworkitem'
INNER JOIN RIDW.VW_REQUEST T3
ON (LT1.REQUEST2_ID = T3.REQUEST_ID)
LEFT OUTER JOIN RICALM.VW_RQST_STRING_M_EXT T4
ON T4.REQUEST_ID=T2.REQUEST_ID AND T4.NAME='custom.ikea.workitem.attribute.country'
LEFT OUTER JOIN RICALM.REQUEST_ATTRDEF T4_2
ON T4_2.REQUEST_TYPE_ID=T2.REQUEST_TYPE_ID AND T4_2.NAME=T4.NAME
LEFT OUTER JOIN RICALM.VW_RQST_ENUMERATION T4_1
ON T4.VAL LIKE CONCAT(CONCAT('%|',T4_1.EXTERNAL_ID), '|%') AND T4_1.PROJECT_ID=T2.PROJECT_ID AND T4_1.ENUMERATION_NAME=T4_2.DATATYPE
WHERE ( T1.CHANGE_DATE >= '2015-01-01' AND
DAYS(CURRENT_TIMESTAMP ) - DAYS(T1.CHANGE_DATE) >= 0 AND
T2.REQUEST_TYPE = 'Feature' AND
(T2.PROJECT_ID = 52 OR T2.PROJECT_ID = 232 OR T2.PROJECT_ID = 442 OR T2.PROJECT_ID = 172 ) AND
T3.REQUEST_TYPE = 'Release' AND
( T3.REFERENCE_ID LIKE '1716' OR T3.REFERENCE_ID LIKE '1579' OR T3.REFERENCE_ID LIKE '1971' OR T3.REFERENCE_ID LIKE '1979' OR T3.REFERENCE_ID LIKE '1184' OR T3.REFERENCE_ID LIKE '1990' OR T3.REFERENCE_ID LIKE '2098' OR T3.REFERENCE_ID LIKE '1990' OR T3.REFERENCE_ID LIKE '1990' )
) AND
(T1.ISSOFTDELETED = 0 AND T2.ISSOFTDELETED = 0 AND T3.ISSOFTDELETED = 0) AND
(T1.REQUEST_STATE_HISTORY_ID <> -1 AND T1.REQUEST_STATE_HISTORY_ID IS NOT NULL) AND
(T2.REQUEST_ID <> -1 AND T2.REQUEST_ID IS NOT NULL) AND
(T3.REQUEST_ID <> -1 AND T3.REQUEST_ID IS NOT NULL) ORDER BY T2.PROJECT_NAME asc,
T3.REFERENCE_ID asc,
T3.NAME asc,
T2.REFERENCE_ID asc,
T2.NAME asc,
T1.REC_DATETIME asc
Thanks
T3.REFERENCE_ID AS REFERENCE_ID1,
T3.NAME AS URL1_title,
T3.URL AS URL1,
T2.REFERENCE_ID,
T2.NAME AS URL2_title,
T2.URL AS URL2,
T4_1.LITERAL_NAME AS LITERAL_NAME,
T2.TAGS,
T2.REQUEST_STATE AS REQUEST_STATE1,
T1.REQUEST_STATE,
T1.REC_DATETIME,
T1.DAYS_IN_STATE,
T1.PREV_REQUEST_STATE
FROM RIDW.VW_REQUEST_STATE_HISTORY T1
INNER JOIN RIDW.VW_REQUEST T2
ON (T2.REQUEST_ID = T1.REQUEST_ID)
INNER JOIN RIDW.VW_REQUEST_RELATIONAL_LINK LT1
ON (T2.REQUEST_ID = LT1.REQUEST1_ID) AND LT1.ISSOFTDELETED = 0 AND LT1.NAME = 'com.ibm.team.workitem.linktype.trackedworkitem'
INNER JOIN RIDW.VW_REQUEST T3
ON (LT1.REQUEST2_ID = T3.REQUEST_ID)
LEFT OUTER JOIN RICALM.VW_RQST_STRING_M_EXT T4
ON T4.REQUEST_ID=T2.REQUEST_ID AND T4.NAME='custom.ikea.workitem.attribute.country'
LEFT OUTER JOIN RICALM.REQUEST_ATTRDEF T4_2
ON T4_2.REQUEST_TYPE_ID=T2.REQUEST_TYPE_ID AND T4_2.NAME=T4.NAME
LEFT OUTER JOIN RICALM.VW_RQST_ENUMERATION T4_1
ON T4.VAL LIKE CONCAT(CONCAT('%|',T4_1.EXTERNAL_ID), '|%') AND T4_1.PROJECT_ID=T2.PROJECT_ID AND T4_1.ENUMERATION_NAME=T4_2.DATATYPE
WHERE ( T1.CHANGE_DATE >= '2015-01-01' AND
DAYS(CURRENT_TIMESTAMP ) - DAYS(T1.CHANGE_DATE) >= 0 AND
T2.REQUEST_TYPE = 'Feature' AND
(T2.PROJECT_ID = 52 OR T2.PROJECT_ID = 232 OR T2.PROJECT_ID = 442 OR T2.PROJECT_ID = 172 ) AND
T3.REQUEST_TYPE = 'Release' AND
( T3.REFERENCE_ID LIKE '1716' OR T3.REFERENCE_ID LIKE '1579' OR T3.REFERENCE_ID LIKE '1971' OR T3.REFERENCE_ID LIKE '1979' OR T3.REFERENCE_ID LIKE '1184' OR T3.REFERENCE_ID LIKE '1990' OR T3.REFERENCE_ID LIKE '2098' OR T3.REFERENCE_ID LIKE '1990' OR T3.REFERENCE_ID LIKE '1990' )
) AND
(T1.ISSOFTDELETED = 0 AND T2.ISSOFTDELETED = 0 AND T3.ISSOFTDELETED = 0) AND
(T1.REQUEST_STATE_HISTORY_ID <> -1 AND T1.REQUEST_STATE_HISTORY_ID IS NOT NULL) AND
(T2.REQUEST_ID <> -1 AND T2.REQUEST_ID IS NOT NULL) AND
(T3.REQUEST_ID <> -1 AND T3.REQUEST_ID IS NOT NULL) ORDER BY T2.PROJECT_NAME asc,
T3.REFERENCE_ID asc,
T3.NAME asc,
T2.REFERENCE_ID asc,
T2.NAME asc,
T1.REC_DATETIME asc
Thanks
Venkatesh Prasad
2 answers
Have you tried using a custom calculation? Also can't excel make a bulk conversion of the date format?
Comments
Hello Rafik,
Thanks for the reply.
Nop, I have not used Custom Calculation. We are using CLM v6.0.3. Is this a new feature available in further versions ? Will using Custom Calculation help in changing the date format please ?
In excel we cannot do it as the end users are a set of top management people from UK who wish to directly download the report from the dashboard into their own systems multiple times a day and view the reports. When they do that, they see the date in mmddyyyy and they are confused. So they need the date format in ddmmyyyy in the report itself.
Can't we do something with the above SQL query itself please..
I tried to use convert (varchar,[date],103) from T1 but that did not work.
Custom calculations require at least Report Builder 6.0.4. If you want to use custom SQL. You can always search the internet for: SQL formatting dates. I will need to know the database backend you are using to be able to answer: Oracle, DB2 or SQL Server?
Comments
Thanks Rafik,
I checked in the internet but no where it gives me the method to change the date format in Report Builder from mmddyyyy to ddmmyyyy
Moreover, I also browsed the net for sparql related information about the date format converting, but could not find anything.
We use DB2
Please could you help here