Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
Node is saved as draft in My Content >> Draft
  • To use DateDiff in SQL for Expiration

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 216
    Comment on it

    To check any link or any information or any message is expired or not we always made a column IsExpired in SQL Server.

     

    While accessing this values we always this value is expired or not

     

    SELECT		N.ID, N.Message, N.Url, U.FirstName + ' ' + U.LastName AS 'TargetUser', U2.FirstName + ' ' + U2.LastName AS 'CreatedBy', 
    				CONVERT(VARCHAR(20), N.CreatedDate, 103) CreatedDate, C.Company, L.Location
    	FROM            Nudge AS N INNER JOIN
                             [User] AS U ON N.TargetUserID = U.ID INNER JOIN
                             [User] AS U2 ON N.CreatedBy = U2.ID INNER JOIN
                             Location AS L ON N.LocationID = L.ID INNER JOIN
                             Company AS C ON L.CompanyID = C.ID
    
    	WHERE		U.AccessToken = @AccessToken AND L.ID > 0 AND N.IsDeleted = 0 AND DATEDIFF(DAY, GETDATE(), N.ExpiryDate) > 0
    
    	ORDER BY	CreatedDate DESC

     

    SQL Server

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: