使用公式如何以DD-MM-YYYY格式获取日期 [英] using formula how to get the date in format of DD-MM-YYYY

查看:178
本文介绍了使用公式如何以DD-MM-YYYY格式获取日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在水晶报告中,我有一个现场日期.

在日期字段中的日期上单击鼠标右键,然后选择格式对象".然后在打开格式编辑器"中有五个菜单,如下所示;通用边框字体段落超链接.

在其中选择通用",然后选中复选框,以消除显示字符串重复"和单击确定".然后打开另一个弹出窗口,选择功能",然后在子菜单中选择日期时间",然后选择日期",拖动日期(YYYY,MM, DD)

拖动并放入其中,当我按如下所示将其放入Date(,,)时.

然后在报告字段中拖动日期"字段并将其放置.

最后的日期为Date({Service.Date},,).然后当我运行时,公式中将出现错误.错误出现.

请帮助我.

in crystal report i have one field date.

Date in the date field right click and select Format Object.Then Open Format Editor in that five menus are there as follows; Common Border Font Paragraph Hyperlink.

In that Select the Common and select the check box suppress if Duplicated Display String and clik ok.Then Open Another Pop up in that Select the Functions in that select the Date Time in the sub menu select the Date, Drag date(YYYY,MM,DD)

Drag and put it in that, when i put it it as follows Date(, ,).

And in the reporting Fields Drag the Date Field and put it.

the final as Date({Service.Date}, , ).then when i run there is an error in formula.error appears.

please help me.

推荐答案

方法1 :格式化对象
遵循步骤,
method 1:format object
Follow Steps,
right click Date-field
-> Format object 
-> select Date and Time tab
-> press Customize button
-> IN New Window Custom Style Select Tab Date
-> Order group select DMY 
   Day of week group select Type=None

   Note: see Sample Text in that window you are getting desire format of date or not try other settings for more formats

-> Press OK




方法2 :使用公式
创建新公式并将其粘贴到公式中的行下方,将其保存并拖放到报表中




method 2:use formula
create new formula and paste below line in formula save it and drag drop to report

totext({Service.Date},"dd-MM-yyyy")


祝您编码愉快!
:)


Happy Coding!
:)


如果您只想将日期格式设置为DD/MM/YYYY

if you just want to Format your Date to DD/MM/YYYY

Console.WriteLine("Today is " + thisDate1.ToString("MMMM dd, yyyy") + ".")
 ' The example displays the following output:
 '    Today is June 10, 2012.





or

Console.WriteLine("Today is " + thisDate1.ToString("dd/mm/yyyy") + ".")
 ' The example displays the following output:
 '    Today is 10/06/2012.








or

textBox1.Text("Today is " + thisDate1.ToString("MMMM dd, yyyy") + ".")
 ' The example displays the following output:
 '    Today is June 10, 2012.


而且永远不要格式化您的日期* ...她不会喜欢它的;)

*一个认识头发和诸如此类的女孩:D


and dont ever Format your Date* ... she wont gonna love it ;)

*a girl you know with hair and such things :D


这篇关于使用公式如何以DD-MM-YYYY格式获取日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆