Home > Back-end > The date format string type yy - mm - dd this how fuzzy query
The date format string type yy - mm - dd this how fuzzy query
Time:11-27
But also have to limit the month and year is the time
Select * from ` caseandcustomer ` where cname like '% a %' and cgettime like '% 2020-08 - %'
Use the SQL statement, a data but look not to come out, cgettime is varchar type
CodePudding user response:
First of all, you want to make sure that a list of all of the time data format is consistent, consistent left directly (replace (cgetime, "-", ""), 6) & gt;=202008 if you don't agree, first turn to the left (DATE_FORMAT (cgettime, '% Y % m % d'), 6) & gt;=202008
CodePudding user response:
In the front of the '%' 2020-08% % and 2020 is a blank space? How do you save the information in the database is? % of fuzzy query on behalf of any character, so the '%' is equivalent to 2020-08% 'any character + space + + any character in the 2020-08', your database is stored like this?