如何将字符串值转换为正确的datetime格式 [英] How to convert string value to proper datetime format
本文介绍了如何将字符串值转换为正确的datetime格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用crystal-report 7
我想将水晶报表中的字符串值转换为datetime
日期格式为 20120102(yyyymmdd)
20120105
...
我想将上述字符串转换为日期格式,如下所示
输出
02/01/2012
05/01/2012
...
需要Crystal报表公式帮助
解决方案您可以尝试使用DateValue函数:
DateValue({myTable.strDate})
否则,解析:
Date({myTable.strDate} [1到4],{myTable.strDate} [5到6],{myTable.strDate} [7到8])
pre>
Using crystal-report 7
I want to convert the string value to datetime in crystal report
date format are
20120102 (yyyymmdd) 20120105 ...
I want to convert the above string to date format like this
expected output
02/01/2012 05/01/2012 ...
Need Crystal report formula help
解决方案You could try the DateValue function:
DateValue({myTable.strDate})
otherwise, parse it:
Date({myTable.strDate}[1 to 4], {myTable.strDate}[5 to 6], {myTable.strDate}[7 to 8])
这篇关于如何将字符串值转换为正确的datetime格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文