Questions tagged [mysql-date]

10 questions
1
vote
2 answers

Retrieve MySql Records Within a Specific Month but Less than the current year and Less than the current Day

I have a number of MySQL records with datetime records. Lets just say they are in a table called my_table and they include the following records. ID Date 1 2021-04-02 2 2020-04-13 3 2019-04-29 4 2018-04-30 5 …
CRAIG
  • 813
  • 1
  • 10
  • 20
1
vote
3 answers

Dealing with Dates in MySQL. Total number of different projects completed

I have a table in an old version of MySQL 5.x like this: +---------+------------+------------+ | Task_ID | Start_Date | End_Date | +---------+------------+------------+ | 1 | 2015-10-15 | 2015-10-16 | | 2 | 2015-10-17 | 2015-10-18 | | …
Raphael
  • 72
  • 8
0
votes
2 answers

How to use LAST_DAY() in MySQL so index advantage is not lost?

I'm using MySQL tables. Sample table EMP (primary_key on (EID, DOJ)) : ENAME EID DEPT SAL DOJ…
Adarsh
  • 960
  • 4
  • 13
0
votes
1 answer

Date format error while inserting values from CSV file into database using python

I have a CSV file that contains the column Registrationdate. It is in format month/day/year. I am trying to read this CSV and insert the data into database. But it shows me a date format error. I know SQL takes data format as year-day-month. But I…
0
votes
1 answer

MySql datetime format change

I have stored date in string format like 'Thu, 24 Dec 2020 07:54:35 GMT'. Can someone please suggest how to convert this string into YYYY-MM-DD format using MySQL query. Tried this function : str_to_date(dateTime, '%a %d %b %Y %T %x') …
shiva
  • 339
  • 4
  • 13
0
votes
1 answer

MySQL server stuck when use CONVERT_TZ

I have a table of Doctor like: ----------------------------- | id | open_at | ----------------------------- | 1 | 2020-03-13 10:50:03 | | 2 | 2020-03-21 23:15:15 | | 3 | 2020-04-11 14:23:11 | ----------------------------- And more…
0
votes
0 answers

MySQL modifies the date I insert

insert into wp_processed values ('306186837','John Wick','Marketplace','2020-06-19 12:21:10','My Dog T-Shirt','5XL','Green','1','79'); And when I select the inserted row it shows that date data is inserted with +3 hours. 2020-06-19 15:21:10 What…
HOY
  • 1,187
  • 9
  • 40
  • 74
0
votes
1 answer

How can I search a column in MySQL containing unix timestamps?

I have mysql table called user_log that contains something like: userid created_at 1 1388514600 2 1391193000 I want to get the record using exact date. For example I have the created_at which is 2013-12-31 SELECT * FROM user_log…
dhamo dharan
  • 480
  • 1
  • 5
  • 22
0
votes
1 answer

how to find out time difference (on day) for every transaction on each users using mysql

I have a table like this: CREATE TABLE test ( ID SERIAL PRIMARY KEY, user_id INT, createdAt DATE, status_id INT ); INSERT INTO test VALUES (1, 12, '2020-01-01', 4), (2, 12, '2020-01-03', 7), (3, 12, '2020-01-06', 7), (4, 13,…
18Man
  • 540
  • 2
  • 13
-1
votes
1 answer

convert MYSQL date time format to UTC time format in Mule 4

I have a requirement where I need to format the dateTime value received from MySql db to UTC time in using Mule 4 Dataweave. Example: i/p: 2021-01-20 00:00:00.0 expected o/p: 2021-01-20T00:00:00.000Z.
akj
  • 21
  • 3