水晶报表分割字符串公式 [英] crystal reports split string formula
问题描述
我只想显示字符串字段的日期部分。
这是字符串的格式: STARTED:/ 03/23/1983 TIME:/ 03:12
我需要删除STARTED:/和TIME:/ 03:12,并且只显示字符串的日期部分: 03/23/1983
。
感谢
Crystal Reports帮助文件是您的朋友,应该是您对内置函数和数据类型的简单问题的第一站。
在CR字符串中只是存储为字符数组所以你可以访问它们像数组 - 按索引。所以在你的情况下,如果你总是有相同的字符串格式(也就是相同的字符数,前导零等),那么你可以这样做:
local stringvar mystr:= {table.your_string}; // mystr:=STARTED:/ 03/23/1983 TIME:/ 03:12
pre>
mystr [11 to 20] // return03/23/1983
或者,您可以使用Mid()字符串函数。
I'm trying to only show the date portion of a string field. This is the format of the string:
STARTED:/ 03/23/1983 TIME:/ 03:12
I need to remove "STARTED:/" and "TIME:/ 03:12" and only show the date portion of the string:
03/23/1983
. What formula can I use to do that?Thanks
解决方案The Crystal Reports help file is your friend and should be your first stop for simple questions on built-in functions and data types.
In CR strings are just stored as character arrays so you can access them like arrays - by index. So in your case, if you will always have the same string format (that is, the same number of characters, leading zeroes, etc.) then you can do something like this:
local stringvar mystr := {table.your_string}; //mystr:="STARTED:/ 03/23/1983 TIME:/ 03:12" mystr[11 to 20] //return "03/23/1983"
Alternatively, you could use the Mid() string function.
这篇关于水晶报表分割字符串公式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!