Sql Server select datetime without seconds
In SQL Server this will work:
DECLARE @now [datetime];
SET @now = GETDATE();
SELECT
CONVERT([varchar](10), @now, 105) + ' ' +
RIGHT('0' + CONVERT([varchar](2), DATEPART(HOUR, @now)), 2) + ':' +
RIGHT('0' + CONVERT([varchar](2), DATEPART(MINUTE, @now)), 2);
In MYSQL it will work
SELECT DATE_FORMAT(date, '%Y-%m-%d %H:%i') AS formated_date FROM table;
In MS SQL It will work
SELECT FORMAT(getdate(), 'dd-mm-yyyy HH:mm')
Since MS SQL 2012, you can use FORMAT
,
SELECT FORMAT([MyDateColumn], 'dd-MM.yyyy HH:mm')