Barbie Posted March 30, 2021 Report Share Posted March 30, 2021 Hi, I have this calculation formula: CASE WHEN CONVERT(VARCHAR, [@field:Date], 108) = '00:00:00' THEN ' ' ELSE CONVERT(VARCHAR, [@field:Date], 108) END I need to do is get the format to be AM/PM. Right now the result is 19:00:00 it should be 7:00 AM. How to achieve that? Quote Link to comment Share on other sites More sharing options...
0 Kuroshi Posted March 30, 2021 Report Share Posted March 30, 2021 Hi @Barbie If you want to have that format, please use the formula below: CASE WHEN CONVERT(VARCHAR, [@field:Date], 108) = '00:00:00' THEN ' ' ELSE CONVERT(VARCHAR,CAST('[@field:Date]' AS TIME),100) END I hope this works now. - Batchini Quote Link to comment Share on other sites More sharing options...
0 Barbie Posted March 30, 2021 Author Report Share Posted March 30, 2021 Thank you @Batchinithat worked. But how can we add the space between minute and AM/PM? Quote Link to comment Share on other sites More sharing options...
0 Kuroshi Posted March 30, 2021 Report Share Posted March 30, 2021 That's great, @Barbie. You can use this formula instead: REPLACE(REPLACE(CONVERT(varchar(15), CAST([@field:Date] AS TIME), 100), 'P', ' P'), 'A', ' A') I hope this satisfies your wrkflow now. Quote Link to comment Share on other sites More sharing options...
0 NailDyanC Posted March 30, 2021 Report Share Posted March 30, 2021 Just to add in the workaround above, you may consider reviewing these links: https://howto.caspio.com/datapages/reports/advanced-reporting/calculations-in-forms-and-reports/ Quote Link to comment Share on other sites More sharing options...
0 cheonsa Posted April 24, 2021 Report Share Posted April 24, 2021 On 3/30/2021 at 10:42 AM, Barbie said: Hi, I have this calculation formula: CASE WHEN CONVERT(VARCHAR, [@field:Date], 108) = '00:00:00' THEN ' ' ELSE CONVERT(VARCHAR, [@field:Date], 108) END I need to do is get the format to be AM/PM. Right now the result is 19:00:00 it should be 7:00 AM. How to achieve that? Hi @Barbie, You can also change the formatting of the result of this Formula. It is only applicable if you are using a DataPage. However, if it is in the Table level, you may use the other solution provided in this thread. Quote Link to comment Share on other sites More sharing options...
0 ParkLoey Posted April 26, 2021 Report Share Posted April 26, 2021 In addition to @LittleMsGinger's suggestion, here is an additional resource for you. It is about field formatting. - LOEY Quote Link to comment Share on other sites More sharing options...
0 Kurumi Posted May 30, 2023 Report Share Posted May 30, 2023 Hi - For Time only fields, you can check this new forum post: Quote Link to comment Share on other sites More sharing options...
0 Kurumi Posted September 19 Report Share Posted September 19 Hi! Caspio now offers integration with OpenAI, so you can use extensions to leverage AI to update your data based on a prompt. Here's a sample use case to get the time only based on the provided Date/Time field. Request: Get the time in "[@field:Date_Submitted]" and change it to 12-hr time. Determine if it is AM or PM. Return only the final result in the format of: HH:MM AM or PM Result: Change the 'Date_Submitted' field to your right field name. To learn more about Extensions, you can check it here: https://howto.caspio.com/integration/extensions/ Quote Link to comment Share on other sites More sharing options...
Question
Barbie
Hi, I have this calculation formula:
I need to do is get the format to be AM/PM. Right now the result is 19:00:00 it should be 7:00 AM. How to achieve that?
Link to comment
Share on other sites
8 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.