1.11M Members

crystal report

 
0
 

" {company.entryDate} In Date(" + string.Format("yyyy,mm,dd", txtStart.Text) + ") To Date(" + string.Format("yyyy,mm,dd", txtEnd.Text) + ")";

this is ASP.NET C# coding for generating report between two dates.
this is giving me this error : "The ) is missing"
pls help..

LastMitch
Deleted Member
 
0
 

this is giving me this error : "The ) is missing"

You are missing a bracket. Count your brackets in your statement. There should be close bracket somewhere here:

"{company.entryDate} 
In Date(" + string.Format("yyyy,mm,dd", txtStart.Text) + ") 
To Date(" + string.Format("yyyy,mm,dd", txtEnd.Text) + ")";

Somewhere in your code (I think you only post end half of the your code not your first part) there is a extra open bracket which is this ( you need a close bracket which is this ) to resolve your issue.

 
0
 

No there is no extra "(" in my code..
i have also checkd this formula in the crystal report formula window its giving me same error.

 
0
 

it would be great if you give me alternative formulaa for this..one.. m feddup trying this

 
0
 

Have you tried adding an extra pair of quotes around the string.format result?

In Date('" + string.Format("yyyy,mm,dd", txtStart.Text) + "') 

I mostly work in Java, so I'm not as familiar with C# nuances, but it looks to me like your constructed string might not have sufficient quotes for the construrctor signature of Date()

 
0
 

yup i had tried that too.. it giving error.. i myself found aletrnative formula for this
--> report.DataDefinition.RecordSelectionFormula = "{company.entryDate}>='" + string.Format("yyyy,mm,dd", txtStart.Text) + " and {company.entryDate}<= " + string.Format("yyyy,mm,dd", txtEnd.Text) + "'";
but now its giving me..this error--> Failed to open a rowset.Conversion failed when converting date and/or time from character string

You
This article has been dead for over six months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article