Quantcast
Channel: ฟอรัม Getting started with SQL Server
Viewing all articles
Browse latest Browse all 8428

Qtr function

$
0
0

I am using this function to get the qtr number by passing the date, so far it is working perfectly, just thought of taking opinion to see if this is right to be pushed to production

FUNCTION QUARTER (@IN_DT DATETIME) RETURNS VARCHAR AS BEGIN DECLARE @VDATE DATETIME DECLARE @SQL VARCHAR(200) SELECT @VDATE = @IN_DT SELECT @SQL = DATENAME(QUARTER,CONVERT(DATETIME, @VDATE)) RETURN @SQL END



Neil



Viewing all articles
Browse latest Browse all 8428

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>