PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → Chart with times. How to format not military time
Chart with times. How to format not military time
Iniciado por guest, 26,oct. 2017 19:33 - 4 respuestas
Publicado el 26,octubre 2017 - 19:33
[attachment 2469 Capture1.JPG]

I have a chart that displays counts for reservations sorted on a time field (last line). How is the best way to display the TIME in non-military time. (am/pm) In the base labels of a graph/chart? The data is built with a query. How would one build a formula to convert a time field into Am/Pm display within a query?
Publicado el 26,octubre 2017 - 19:53
If your database is HFSQL you can use WLanguage functions in the queries.

try using WL.TimeToString in the query.

https://doc.windev.com/en-US/…
https://doc.windev.com/en-US/…
Publicado el 27,octubre 2017 - 02:07
Thanks Paulo.
I have tried this. But I get errors when I try to add the format. Any examples would be appreciated. I am using WD22.
Publicado el 27,octubre 2017 - 13:16
Jim
In your query add a calculated item and choose WLanguage functions.
Syntax of item should beWL.DateToString(YourDate,'HH:MM') Note the use of asterisks NOT inverted commas around the date format.

This of course applies to any text you need to be returned from a calculated field.
Publicado el 27,octubre 2017 - 15:07
Thanks. The single quotes is the key. The help documentation uses double quotes?