Skip to content

Instantly share code, notes, and snippets.

@johnmackintosh
Last active October 26, 2023 08:40
Show Gist options
  • Save johnmackintosh/58da075ec3fb54a2c1d3572e4fc4a4f5 to your computer and use it in GitHub Desktop.
Save johnmackintosh/58da075ec3fb54a2c1d3572e4fc4a4f5 to your computer and use it in GitHub Desktop.
flooring datetime to 15 minute intervals and using case when
SELECT [MovementDateTime],
[FirstName],
[LastName],
[Ward_Dept],
[Staging_Post],
[Movement_Type],
[IN_OUT],
cast(round(floor(cast([MovementDateTime] AS float(53))*24*4)/(24*4),5) AS smalldatetime) AS Movement15,
(CASE WHEN IN_OUT = 'IN' THEN 1 ELSE -1 END) AS [counter]
FROM [DB].[dbo].[TABLENAME]
GO
@johnmackintosh
Copy link
Author

@Regank12
Your comment appears to have no relevance, so I'm deleting it.
Again.

@Offe1981
Copy link

Offe1981 commented Oct 26, 2023

This is an impressive post for you. However, polished concrete in Philadelphia is gaining popularity due to its smooth, modern appearance and durability. Its polished concrete Philadelphia reflecting surface offers depth and flair to both homes and businesses. It is a good alternative for people looking for an economical yet stylish flooring solution because it requires little maintenance and has a long lifespan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment