Posted By

kashif21 on 04/27/11


Tagged


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

franksmile0310


A solution for the date comparison plus same date


 / Published in: SQL
 

  1. SET @dtmToDate = DATEADD(DD, 1, @dtmToDate)
  2. SELECT TOP (@intMaximumRowsToReturnOnGrid)
  3. SysUserAuditID,
  4. LoginName,
  5. LoginDatetime,
  6. IPAddress,
  7. CASE IsAuthenticated
  8. WHEN 1 THEN 'Yes'
  9. ELSE 'No'
  10. END AS IsAuthenticated
  11. FROM
  12. AuditLogin
  13. WHERE
  14. (@strUserName = '' OR LoginName LIKE '%' + @strUserName + '%')
  15. AND LoginDateTime >= @dtmFromDate AND LoginDateTime <= @dtmToDate

Report this snippet  

You need to login to post a comment.