Discussione:
Formattazione data
(troppo vecchio per rispondere)
Claude
2022-08-29 06:39:42 UTC
Permalink
Buongiorno a tutti.

Vi chiedo scusa, ho una data in questo formato AAAAMMDD 20221221

Vorrei trasformarla in una cosa pi leggibile per l'utente 21/12/2021.

Esiste una funzione da usare con una select per poterlo fare?

Es.

select funzione(data, formato) from xxxx

Grazie.
--
Sent from Windows 10
Renzo
2022-08-29 06:44:05 UTC
Permalink
Post by Claude
Buongiorno a tutti.
Vi chiedo scusa, ho una data in questo formato AAAAMMDD 20221221
Vorrei trasformarla in una cosa pi leggibile per l'utente 21/12/2021.
Esiste una funzione da usare con una select per poterlo fare?
Es.
select funzione(data, formato) from xxxx
Grazie.
CONCAT(CONCAT(CONCAT(SUBSTRING(AAAAMMDD, 7, 2), '/'),
CONCAT(SUBSTRING(AAAAMMDD, 5, 2), '/')),
SUBSTRING(AAAAMMDD, 1, 4))
AS DATAFORMATTATA
Claude
2022-08-29 06:50:28 UTC
Permalink
Post by Renzo
CONCAT(CONCAT(CONCAT(SUBSTRING(AAAAMMDD, 7, 2), '/'),
CONCAT(SUBSTRING(AAAAMMDD, 5, 2), '/')),
SUBSTRING(AAAAMMDD, 1, 4))
AS DATAFORMATTATA
Eh vabbè... Veramente grazie molte.

Birra pagata se passi da Modena.
--
Sent from Windows 10
Continua a leggere su narkive:
Loading...