Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

pass date field from web page to crystal report

Status
Not open for further replies.

kuo

Programmer
Nov 7, 2002
14
0
0
US
HI.

I am using ColdFusion page to pass date field to crystal report. in the text box, it says 1/12/2002, but crystal report can't reconize it. how to pass it.


thanks for the help.
 
Crystal will normally accept something in the Date(yyyy,mm,dd) format.

Lisa
 
thanks.

are you saying in the text filed, just type yyyy,mm,dd


thanks for the help.
 
It should be in this format: DateTime(1900,1,1,1,1,1)

So we create a function to send it to csp page in same format

function formatCESDate(strDate)
{

var mm,dd,yy,newDate,cesDate
if ((strDate !=null) && (strDate != ""))
{
newDate = new Date(strDate)
mm = newDate.getMonth()+1;
dd = newDate.getDate();
yy = newDate.getFullYear();
cesDate = "DateTime("+yy+","+mm+","+dd+",1,1,1)"
}
else
cesDate ="DateTime(1,1,1,1,1,1)"
return cesDate
}

Hope that helps.

Dee
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top