Converting MYSQL VARCHAR column to TIME
Closed
BrianGreen
Posts
1005
Registration date
Saturday January 17, 2015
Status
Moderator
Last seen
September 30, 2021
-
Jun 16, 2020 at 10:14 AM
Th4Ac3 - Sep 10, 2020 at 09:33 AM
Th4Ac3 - Sep 10, 2020 at 09:33 AM
Related:
- Converting MYSQL VARCHAR column to TIME
- Popcorn time download - Download - Movies, series and TV
- Ocarina of time rom - Download - Action and adventure
- How to change time in whatsapp - Guide
- Summer time saga - Download - Adult games
- Convert m3u to mp3 - Guide
6 responses
Good afternoon brian, its nice to see you back.
Ise the command
Alter table TABLENAME
Alter column columnname newdatatype(size)
As for the bulls, it will only matter if you have set the NOT NuLl constraint on the table.
I hope this helps out, but then again they wont let me post here, so you probably will receive no help as no one here knows anything really.
Have fun.
Mark
Ise the command
Alter table TABLENAME
Alter column columnname newdatatype(size)
As for the bulls, it will only matter if you have set the NOT NuLl constraint on the table.
I hope this helps out, but then again they wont let me post here, so you probably will receive no help as no one here knows anything really.
Have fun.
Mark
Good afternoon brian, its nice to see you back.
Use the command
Alter table TABLENAME
Alter column columnname newdatatype(size)
As for the nulls, it will only matter if you have set the NOT Null constraint on the table.
I hope this helps out.
Have fun.
Use the command
Alter table TABLENAME
Alter column columnname newdatatype(size)
As for the nulls, it will only matter if you have set the NOT Null constraint on the table.
I hope this helps out.
Have fun.
BrianGreen
Posts
1005
Registration date
Saturday January 17, 2015
Status
Moderator
Last seen
September 30, 2021
149
Jun 16, 2020 at 11:25 AM
Jun 16, 2020 at 11:25 AM
Thanks for the try, but doing this I get the message:
I have also tried to use Timestamp(8) but get the same message (the current time in the VARCHAR is 8 characters long).
I think I will be forced to convert the VARCHAR into a TIME format in the PHP page and do the maths with the conversion. It will slow the site, but at least it will work ... sort of.
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Timestamp(6)' at line 2
I have also tried to use Timestamp(8) but get the same message (the current time in the VARCHAR is 8 characters long).
I think I will be forced to convert the VARCHAR into a TIME format in the PHP page and do the maths with the conversion. It will slow the site, but at least it will work ... sort of.
purusottamnath09
Posts
2
Registration date
Monday August 31, 2020
Status
Member
Last seen
September 13, 2020
Sep 9, 2020 at 01:22 PM
Sep 9, 2020 at 01:22 PM
Follow this link to know more about Sql database fundamentals ...
https://tequality.tech/course/sql
https://tequality.tech/course/sql
Didn't find the answer you are looking for?
Ask a question
Brian, its me, Mark, I hope you get this as this thing doesnt allow me to correctly answer posts. Use Cast to change values in a query without changing the data type. So the syntax would be
CAST(Your_column AS DATE() )
I HOPE THIS FINDS YOU WELL.
CAST(Your_column AS DATE() )
I HOPE THIS FINDS YOU WELL.
Brian, Its me, Mark. I hope this finds you well. I have a hard time posting ACTUAL HELPING, WORKING SOLUTIONS here, so don't be surprised when I no longer can answer your returning questions, and there is no one to assist you any longer on your business solutions!
Use the CAST() function to change a value, or match a value, when the variable is not the correct data type. The syntax would be as follows:
SELECT ....
From ........
Where........
AND Period.END_DATE >= Cast("SOMEVARIABLE" AS DATE)
I hope this helps. Sorry if it take a long time to get back, if there are any follow ups.
//ark
Use the CAST() function to change a value, or match a value, when the variable is not the correct data type. The syntax would be as follows:
SELECT ....
From ........
Where........
AND Period.END_DATE >= Cast("SOMEVARIABLE" AS DATE)
I hope this helps. Sorry if it take a long time to get back, if there are any follow ups.
//ark