# Re: Crystal Report 之 Date 问题!

Posted by Nelson on January 04, 1999 at 09:15:19:

In Reply to: Crystal Report 之 Date 问题! posted by 金田七 on January 04, 1999 at 03:27:15:

: 本人欲选择两个日子中的资料, 程式如下:

: CrystalReport1.ReportFileName = "C:\HQMain\ShopRet.rpt"
: CrystalReport1.DataFiles(0) = "C:\HQMain\mdb\main.mdb"
: CrystalReport1.SelectionFormula = "{零售资料.日期}between '#" & Text2.Text & "# and #" & Text1.Text & "#"
: CrystalReport1.Action = 0

: 程式发生错误,不知何处出现问题,请教各方高人之意见. 谢谢!

我想你应该用的是4.5版的Crystal Report
很抱歉,没用过.不过提供你6.0版的Crystal Report,语法应该差不多啦
CrystalReport1.SelectionFormula = "{零售资料.日期} in date(12,31,1998) to date(1,1,1999)"
如果没错,应该是用in .. to .. 而不是用between
试试吧

Follow Ups: