简体   繁体   English

excel将mysql日期格式作为文本格式

[英]excel is taking mysql date format as text format

we are trying to write formulas with mysql date format. 我们正在尝试使用mysql日期格式编写公式。 we exported mysql dates. 我们导出了mysql日期。 we are getting date formats mm/dd/yy format. 我们正在获取日期格式mm/dd/yy格式。 But excel taking it as TEXT format. 但擅长将其作为TEXT格式。

In mysql we tried to approaches. 在mysql中,我们尝试了方法。

first one is DATE_FORMAT like below 第一个是DATE_FORMAT如下所示

DATE_FORMAT(column_name, "%c/%e/%y")

second one is FROM_UNIXTIMESTAMP 第二个是FROM_UNIXTIMESTAMP

FROM_UNIXTIME(UNIX_TIMESTAMP(pa.value),'%c/%e/%y')

for first one it is recognizing as TEXT format for second one it is recognizing as DATE format. 对于第一个,它被识别为TEXT格式;对于第二个,它被识别为DATE格式。 But again we have to click on the column's manually. 但是同样,我们必须手动单击列。 After selecting/clicking on the columns then excel taking them as date. 在选择/单击列之后,然后将其视为日期,以excel

are there any suggestions/solutions for the problem? 有什么建议/解决方案吗? Thanks in advance :) 提前致谢 :)

CAST(date_columb AS DATE)这个工作非常好:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM