Utilizzo di un campo derivato per generare l'ora in formato 24 ore
Problema o errore: in che modo è possibile generare l'ora nel formato 24 ore in Campaign?
Soluzione: per ottenere il formato orario di 24 ore, è possibile creare un campo derivato in Campaign utilizzando la seguente istruzione.
if((string_seg(10, 11, Current_Time()) = 'PM' 
AND number(string_seg(1, 2, Current_Time()))< 12) ,
string_concat(format((number(string_seg(1, 2, Current_Time()))+ 12),2),
string_seg(3, 8, Current_Time())),
if ((string_seg(10, 11, Current_Time()) = 'AM'
AND number(string_seg(1, 2, Current_Time())) = 12),
string_concat('00', string_seg(3, 8, Current_Time())),
string_concat(string_seg(1, 2, Current_Time()),
string_seg(3, 8, Current_Time()))))
*
Di seguito viene indicato un metodo alternativo che consente di ottenere lo stesso risultato.
StripHour = string_seg(1, 2, Current_time())
HourNum = number(StripHour)
StripPM = string_seg(10, 11, Current_time())
StripRest = string_seg(3, 8, Current_time())
if((StripPM = 'PM' AND HourNum < 12),
string_concat(format((HourNum + 12),2), StripRest),
if ((StripPM = 'AM' AND HourNum = 12), string_concat('00', StripRest),
string_concat(Strip_Hour, StripRest)