" {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..

Member Avatar for LastMitch

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.

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.

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

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()

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.