I would like to format my Date/Time field into this format: mm/dd/yyyy HH:MM (AM/PM). I found this solution, but getting an error for some of the quotations:
concat(substring(MyDateTime, 6, 2), “/”, substring(MyDateTime, 9, 2), “/”, substring(MyDateTime, 1, 4), ” “, substring(MyDateTime, 12, 2) mod 12 + 12 * (substring(MyDateTime, 12, 2) mod 12 = 0), substring(MyDateTime, 14, 3), ” “, substring(“AP”, 1 + (substring(MyDateTime, 12, 2) >= 12), 1), “M”)
To add to this, I changed my process to military time:
concat(substring(TransferOutDatePatientLeftFacility, 6, 2), "/", substring(TransferOutDatePatientLeftFacility, 9, 2), "/", substring(TransferOutDatePatientLeftFacility, 1, 4), " - ", number(substring(TransferOutDatePatientLeftFacility, 12, 2)),":",number(substring(TransferOutDatePatientLeftFacility, 15, 2)))
For this, I would like to add a colon between the hour and mins field. When I added it, it showed an error for the quotation mark before the colon. If I took the colon out, it worked. However, it doesn't pull both of the mins fields. It should pull two numbers. But if the time is 13:00, it shows 130. If the time was 1302, it shows 132. Any thoughts.