Questions tagged [sql-timestamp]

263 questions
0
votes
1 answer

cannot insert datetime field with stored procedure into mysql database

I am getting this syntax error when trying to insert a datetime into mysql database. pymysql.err.ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to…
vkan
  • 123
  • 4
0
votes
3 answers

Converting java.time.LocalTime to java.sql.Time

I am currently getting an IllegalArgumentException thrown at these lines of code: Time timeIn = Time.valueOf( res.getCheckInTime().toString()); Time timeOut = Time.valueOf( res.getCheckOutTime().toString()); Both arguments are LocalTime storing the…
Ali
  • 11
  • 1
0
votes
0 answers

Can you index a transformation e.g. event_timestamp::date

I'm preparing an 'ideal' events fact table to hand off to our engineers to build. My question is, if we have an event timestamp field event_time and I want to index the dates only, is it possible to index event_time::date or must I request a…
Doug Fir
  • 19,971
  • 47
  • 169
  • 299
0
votes
4 answers

Easiest way to convert YYYYMMDD to the midnight with specific timezone on PostgreSQL?

I get the dates in a YYYYMMDD format. I need to convert this column to the timestamp with specific timezone. What is the best/easiest way to do that? So if I have 20210101 I want to get 2021-01-01 00:00:00.000000 in my TZ.
botafogo
  • 189
  • 7
0
votes
1 answer

InfluxDB: How can I find the timestamp of the next sample?

I have a rather large time series (500 M samples) with irregular timestamps. In particular, I have times where samples are very tightly spaced (ms) and then very large gaps (no samples for days). I often pull the entire series from Influx to process…
blondiepassesby
  • 181
  • 1
  • 7
0
votes
1 answer

query to convert rows to columns in SQL

this is my query: with Q1 as ( select *, LAG(ignition) over (ORDER BY [timestamp]) as PrevStatus, LEAD(ignition) over (order by [timestamp]) as NextStatus FROM vehiclehistorytable WHERE…
woo25
  • 5
  • 6
0
votes
1 answer

Update only time in timestamp postgresql

I have to update a timestamp in my database, but I want to change only the time, keeping the once registered date, for example, in '2021-10-07 11:00:00' I want to update it to '2021-10-07 10:00:00', how can I accomplish that? the query I tried to…
0
votes
1 answer

MySQL 5.1.73 Change timestamp format for general_log file

I'm trying to change the format of the general log file generated by MySQL 5.1.73. the actual timestamp format for "event_time is: "210909 10:32:12 12 Connect user@localhost on database" Is there a possibility for changing its timestamp format ? I…
user12213762
0
votes
1 answer

asp:SqlDataSource with ROWVERSION (TIMESTAMP)

I ran into .NET (Framework, w/ WinForm and WebForms) / MS SQL project where significant tables in the database contain a TIMESTAMP (aka ROWVERSION) column (called tsModified) to prevent concurrency issues. Additionally, this project does not allow…
0
votes
0 answers

TimeStamp Epoch Conversion in Kafka Connect Issue

Using Confluent Community edition of Kafka and I am doing data transfer from SQL server to Kafka topics in JSON format. Date-Timestamp fields from SQL server are getting converted to epoch milliseconds. But I want to restrict that conversion, can I…
0
votes
1 answer

Rows with a timestamp value yesterday in DB2

How do I select rows with a timestamp value at any time yesterday? The DBMS is DB2. SELECT * FROM my_table WHERE CAST (my_timestamp_col AS DATE) = CURRENT DATE - 1 DAY This is what I currently have but is casting timestamps as date inefficient?…
haba713
  • 2,465
  • 1
  • 24
  • 45
0
votes
2 answers

convert time to decimal data type in PostgreSQL

In PostgreSQL / pgadmin - How do I cast timestamp (HH:MM:SS) as decimal so I can multiply by hourly_rate (XX.YY$) and get total charge_amount? For the life of me I can't find any reasonably simple solution on Google or this forum. Can it be that's…
danb2000
  • 19
  • 3
0
votes
0 answers

How to convert date in words to timestamp and vice versa php

I am trying to convert a date in words Mar 02 2018 to a timestamp and convert it back to the original format(Mar 02 2018) This is because I want the users to input date in this format then it is save to the database as a timestamp so that the sql…
user14145952
0
votes
1 answer

How to Create text string in MySQL against all records in a view

I'm looking to see if I can create a view where I can create a third column that always shows a text string made up of the Current Year-Current WeekNo so a sample would be 2021-26 or 2021-23. The whole point is that I effectively need to timestamp…
Dan Hardy
  • 15
  • 3
0
votes
2 answers

Difference between 2 timestamps in Oracle SQL

Please help in finding the difference between 2 timestamps in SQL I tried using Select (cast(sysdate as timestamp) - cast(sysdate-2 as timestamp)) diff from dual; I got 'ORA-00911:invalid character' error
Anonymous
  • 13
  • 2
  • 6