Skip to content
Advertisement

Tag: datetime

SQL Server – Can’t change datetime to date

I have this sql which has some date format issue, problem is that I can freely change EndDate to whatever I want, but for StartDate I can’t seem to change it one bit, it always have this timestamp that I am trying to get rid of. Basically whatever I do in varchar, date or any format I just can’t change

How to find the average time? SQL Server 2017

I have a request like this: I need to find the average time for each status. For example, add up the time of all statuses 2 and divide by their number. As a result, get something like 2 days 5 hours. How to fix my request to make belt operations possible? Answer Taking your limited example data, something like this

ORACLE DATETIME ROUND UP WHEN MINUTES 0

I have a datetime: I need to round up just when the minutes are different to 00. Example: 1/1/2000 2:37:00 AM => should be => 1/1/2000 3:00:00 AM. (dont round up if hour =00) 1/1/2000 2:00:00 AM => should be => 1/1/2000 2:00:00 AM For now my code has round function but this one look the nearest hour, I need

Query table with multiple “duplicates”, getting the most recent

I have a table which stores predictions from a machine learning model. This is a model that each hour (“predicted_at”) predicts a value for the next 24 hours(“predicted_for”). This means that the table have many different values for each “id” and “predicted_for”. Example of how the the table looks like for one ID and one predicted_for timestamp: value id predicted_at

Display records that are not present in a table and a given date range

Let’s say I have two tables – Student and Student Attendance tables. The Student table displays basic information about the student: Student# FirstName LastName 201710 John Smith 201711 John Doe 201712 Anna Sy 201713 Chris Dy While the Student Attendance table displays the TimeIn and TimeOut of the student from class: Student# Date TimeIn TimeOut 201710 2016-01-06 00:09:00.000 00:15:00.000 201711

Advertisement