Discussion:
how to get the date from the first date
(too old to reply)
Niraj Kothari
2021-07-29 09:11:57 UTC
Permalink
what is the sql query to find out the full date where we put the starting date means 09/08/2020 We Only put 09. and how i will get 09/08/2020 This date
J.O. Aho
2021-07-29 12:10:31 UTC
Permalink
Post by Niraj Kothari
what is the sql query to find out the full date where we put the starting date means 09/08/2020 We Only put 09. and how i will get 09/08/2020 This date
select day_column_name + "/08/2020" from table_name;

To get a whole date you have to store the whole data, change the column
type VarChar(2) to one of the following:

- Date [Format: YYYY-MM-DD, Range: '1000-01-01' to '9999-12-31']

- DateTime [Format: 'YYYY-MM-DD hh:mm:ss[.fraction]', Range: '1000-01-01
00:00:00.000000' to '9999-12-31 23:59:59.999999']

- TimeStamp [Format: 'YYYY-MM-DD hh:mm:ss[.fraction]', Range:
'1970-01-01 00:00:01.000000' to '2038-01-19 03:14:07.999999']


Then you can use DAY(date_column_name) to get the day from the
Date/DateTime/TimeStamp and DATE_FORMAT(date_column_name, '%d/%m/%Y') to
be sure to get it in the odd format you want to get it in.
--
//Aho
Loading...