Tuesday, 18 July 2017

Date Filter With From And To Date in MsSql

DECLARE @FromDate datetime
Declare @ToDate datetime

SET @FromDate='06/01/2017'
SET @ToDate='07/18/2017'

SELECT *
FROM SiteActivity SA
LEFT JOIN Users CU ON CU.userCode=SA.ModifiedBy
Where CAST(SA.ModifiedON AS DATE) BETWEEN CAST(@FromDate AS VARCHAR(20)) AND CAST(@ToDate AS VARCHAR(20))

No comments:

Post a Comment

React Hooks - custom Hook

  v CustomHook Ø React allows us to create our own hook which is known as custom hook. Example – 1 localStorage Demo Step-1 Create ...