![]() How to Convert Date to String with the STR_TO_DATE() Function You can use a date written as a string, then specify DATE as the data type you want to convert it to: SELECT CONVERT("", DATE) I wrote about them in this tutorial if you'd like to read more.įunctions are not the only parameter you can use as the first argument of the convert function. There are many other functions you can use for working with dates. You can also use SYSDATE() in its place if you want to: SELECT CONVERT(SYSDATE(), CHAR) The second argument, CHAR, is the data type the date got converted to. The query above used the NOW() function to get the current date and time. Here's the CONVERT() function in action: SELECT CONVERT(NOW(), CHAR)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |