About me / Hey I’m Tim. I work as a systems integration specialist for a large educational institution in the Netherlands. A part of my free time I spend making and creating music.
MySQL example to convert UTC timestamp to specific timezone.
SELECT
SensorName,
MAX(CONVERT_TZ(LastUpdated, 'UTC', 'Europe/Amsterdam')) AS LastUpdated
FROM Sensors
WHERE (TIME_TO_SEC(TIMEDIFF(NOW(), CONVERT_TZ(LastUpdated, 'UTC', 'Europe/Amsterdam'))) < 1800)
GROUP BY SensorName;
SELECT [datumtijd]
,(CAST(body AS XML).query('declare namespace ns1="http://totietoot.nl/example/person/1/0";
declare namespace soapenv="http://schemas.xmlsoap.org/soap/envelope/";
declare default element namespace "http://totietoot.nl";
//soapenv:Envelope/soapenv:Body/ns1:Members/ns1:Person/ns1:ID'
).value('.', 'nvarchar(100)')) AS ID
,(CAST(body AS XML).query('declare namespace ns1="http://totietoot.nl/example/person/1/0";
declare namespace soapenv="http://schemas.xmlsoap.org/soap/envelope/";
declare default element namespace "http://totietoot.nl";
//soapenv:Envelope/soapenv:Body/ns1:Members/ns1:Person/ns1:Name'
).value('.', 'nvarchar(100)')) AS Name
--,[body]
FROM [DATABASE].[dbo].[Logtable]
WHERE [kolom1] = 'waarde'
ORDER BY datumtijd DESC