Quantcast
Channel: função data
Viewing all articles
Browse latest Browse all 5

função data

0
0
Ola,
tenho este script

CREATE FUNCTION dbo.FN_RetornaData_DD_MM_YYYY (@data DATETIME = null)

RETURNS DATETIME AS

BEGIN 
     RETURN CONVERT(DATETIME, CONVERT(VARCHAR, @data, 103))  

END

Quando executo:
SELECT dbo.FN_RetornaData_DD_MM_YYYY( GETDATE())

me retorna:
2020-03-06 00:00:00.000.

porem gostaria que retornasse:
03/06/2020

Como faço?

Maricelmo


Viewing all articles
Browse latest Browse all 5

Latest Images





Latest Images