Tag Archives: SQL Date time functions

Script to find complete months between two given dates

Complete months between two given dates Below script will help in finding the complete months within the 2 given dates. In the below script we takes below dates as exampleStartdate =2015-07-05 Enddate =2016-01-06 /**********************Script Start**************************/ IF (object_id(‘tempdb..#month’) is not null) … Continue reading

Posted in Interview Questions, SQL Basic, SQL Server | Tagged , , | Leave a comment

SQL Server – Convert() function

Convert () function in SQL Server Convert () function is used to convert an expression from one data type to another data typeSyntax for CONVERT function CONVERT ( data_type [ ( length ) ] , expression [ , style ] ) Convert functions … Continue reading

Posted in SQL Basic, SQL Functions, SQL Server | Tagged , | 31 Comments