Questions tagged [sql-timestamp]
263 questions
0
votes
1 answer
Postgresql Timestamp Min Max Incorrect/ How to handle outliers
this is my first post, so pls be patient with me. I'm fairly new at sql, but i think i have a few basics down.
I'm trying to calculate how much time each person is on site. There are serveral timestamp so i've been using the following code
MIN…

Maria Campos
- 1
- 1
0
votes
0 answers
Combine time and timestamp to select timed data in php and mysql
I have two columns in my MySql database
activeAt(timestamp)
activeAtTime(time)
I want to fetch data that are less than activeAtTime(timestamp) and activeAt(time)
The problem I'm facing in my code is
if activeAt is 25th may & activeAtTime is 5pm of…

Sudhakar Behera
- 91
- 2
- 10
0
votes
1 answer
How to compare timestamp with time using pl/sql?
I have parameter :dateSend which has type timestamp and I am trying to make this evaluation.
CASE WHEN :dateSend <= TO_TIMESTAMP('14:00:00', 'HH24:MI:SS') THEN 0 ELSE 1 END A
It doesn't work. Maybe I should convert :dateSend to time? Like…

German Varanytsya
- 377
- 1
- 4
- 16
0
votes
1 answer
I just want to use time in this colum (novice)
CREATE TABLE Vitals
(
Record_No int NOT NULL PRIMARY KEY,
Patient_ID int,
Date_Taken DATE NOT NULL,
Time_Taken time(7) NOT NULL,
Systolic int,
CHECK (Systolic > Diastolic),
Diastolic int,
Heart_Rate …

Nora Pī
- 1
- 1
0
votes
1 answer
Oracle SQL - select query with where condition greater than certain moment defined in a timestamp column
I have a table where there is a column, report_time, whose type is timestamp. A value of it looks like "25-May-20 05.03.20.12000 PM", now I want to filter out all rows whose report_time is greater than or equal to that moment, a pseudo where clause…

J.E.Y
- 1,173
- 2
- 15
- 37
0
votes
2 answers
Convert input date in YYYY-MM-DD'T'HH:MM:SS:SSS+HHMM format to the java.sql.Timestamp with the timezone from input
We have a requirement wherein the string is passed from UI in YYYY-MM-DD'T'HH:MM:SS:SSS+HHMM along with timezone (say example: 2020-01-20'T'05:40:334-0500) whcih needs to be parsed into sql timestamp to be inserted to DB.
All attempts are ignoring…

Ajay Dsouza
- 307
- 3
- 10
0
votes
1 answer
why java.sql.Timestamp return negative value when the date is after 1970-01-01
Timestamp timestamp = Timestamp.valueOf("1970-01-01 01:00:00");
System.out.println(timestamp.getTime());
Any idea this code returns -25200000 ?
I thought time after 1970-01-01 00:00:00 will be positive.

Bargitta
- 2,266
- 4
- 22
- 35
0
votes
1 answer
SQL Server : counting time between two values in two columns
I'm brand new to SQL Server (3 days experience so far) and I'm at a loss how to accomplish this outside excel, sorry if this is hard to explain.
Table example at bottom:
I have a table with timestamps every minute, a part counter, and error codes.
I…

Metal
- 15
- 4
0
votes
1 answer
HSQL problem when using TIMESTAMP value as IN parameter in stored procedure
Overview HSQL IN parameter of type TIMESTAMP doesn't work as expected for HSQL stored procedure.
Given the following DDL :
CREATE TABLE TS_STORE (
ID_COL VARCHAR(20) NOT NULL PRIMARY KEY,
TS TIMESTAMP
);
A DML statement such as :
INSERT…

garfield
- 571
- 9
- 21
0
votes
1 answer
Converting timestamp string to timestamp in Presto - Malform error
I am trying to convert a timestamp string to timestamp with date_parse, but keep getting an error. Any suggestions? I am working on Presto SQL. I have tried to replace %H:%f with %T and it still doesn't work.
date_parse(sg."@timestamp", '%Y-%m-%d…

Albert Ng
- 1
- 1
0
votes
2 answers
Compute Difference Between Two Timestamps
I have two Timestamp columns in a PostgreSQL table (e.g, 2019-07-12 07:59:59). I need to subtract two columns and save the (HH:MM:SS) value under new name?

Vivek
- 1
0
votes
1 answer
Calculate minutes between two or more timestamps in SQL
My question: is there a way to calculate the difference between two timestamps with a SQL query?
I have a database table (MySQL 5.6) with different timestamps:
id start_time end_time employee
1 2020-02-01 06:00:00 2020-02-01…

T. Hægh
- 109
- 1
- 9
0
votes
1 answer
Format conversion for TimeStamp to Date
I need to convert data for all files which have below :
TO_DATE('01/31/1970 12:00:00 AM','MM/DD/YYYY HH:MI:SS AM')
to simple 31-JAN-1970 format using some automation (bash/Linux/UNIX command should do)

shivi
- 1
0
votes
1 answer
Laravel - MySQL - Timestamp performance vs boolean column?
I'm currently running different queries where I want to exclude those users that have not been active for the last 36 hours.
My users table has a last_connection_time, which is a timestamp with the last time that the user connected.
I was thinking…

Inigo EC
- 2,178
- 3
- 22
- 31
0
votes
1 answer
How to handle local time zone change when syncing data to server?
I have an android app. The application performs some tasks and updates the status of those tasks in local DB with the timestamp. Suppose the User logged an event. So an entry is added to event table with event_name and time_stamp. For timestamp, I…

Pardeep Kumar
- 900
- 1
- 14
- 30