+ Start a Discussion
Sylvio AvillaSylvio Avilla 

#Error! in Report displaying DateTime Formula

Hello everyone!

I Have a strange problem with a Custom Object formula. It works perfectly, until I run the report. If the DateTime is between, let's say 01/01/2015 01:00 and 01/01/2015 01:09 ( that means if there is a 0 (zero) before the ":") the report returns an #Error!

Here the Formula:
DATETIMEVALUE(DATETIMEVALUE(TEXT(YEAR(SGAAF__data_da_viagem__c))+"-" +TEXT(MONTH(SGAAF__data_da_viagem__c))+"-" 
+TEXT(DAY(SGAAF__data_da_viagem__c))+" "+TEXT(VALUE(LEFT(SGAAF__Hora_Saida_Base__c, 2)))+ ":"+TEXT(VALUE(RIGHT(SGAAF__Hora_Saida_Base__c, 2)))+
":11")+SGAAF__GMT_horario_de_verao__c)
Custom Field:
Custom  Field

Report:

Report

Does anyone have a clue how can I fix it?

Thanks 

Sylvio
Best Answer chosen by Sylvio Avilla
William TranWilliam Tran
Try to remove the value from left/right function:
 
DATETIMEVALUE(
DATETIMEVALUE(
TEXT(YEAR(SGAAF__data_da_viagem__c))+"-" +
TEXT(MONTH(SGAAF__data_da_viagem__c))+"-" +
TEXT(DAY(SGAAF__data_da_viagem__c))+" "+
LEFT(SGAAF__Hora_Saida_Base__c, 2)+ ":"+
RIGHT(SGAAF__Hora_Saida_Base__c, 2)+
":11")
+SGAAF__GMT_horario_de_verao__c)

As a common practice, if your question is answered, please choose 1 best answer. 
But you can give every answer a thumb up if that answer is helpful to you. 

Thanks

 

All Answers

William TranWilliam Tran
Try to remove the value from left/right function:
 
DATETIMEVALUE(
DATETIMEVALUE(
TEXT(YEAR(SGAAF__data_da_viagem__c))+"-" +
TEXT(MONTH(SGAAF__data_da_viagem__c))+"-" +
TEXT(DAY(SGAAF__data_da_viagem__c))+" "+
LEFT(SGAAF__Hora_Saida_Base__c, 2)+ ":"+
RIGHT(SGAAF__Hora_Saida_Base__c, 2)+
":11")
+SGAAF__GMT_horario_de_verao__c)

As a common practice, if your question is answered, please choose 1 best answer. 
But you can give every answer a thumb up if that answer is helpful to you. 

Thanks

 
This was selected as the best answer
Sylvio AvillaSylvio Avilla
It worked!

Thanks for your help William