1,105,391 Community Members

crystal report

snybhandari
Newbie Poster
4 posts since Jun 2013
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
Unverified Member
 
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.

snybhandari
Newbie Poster
4 posts since Jun 2013
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
Unverified Member
 
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.

snybhandari
Newbie Poster
4 posts since Jun 2013
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
Unverified Member
 
0
 

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

Member Avatar
Ezzaral
Posting Sage
7,431 posts since May 2007
Reputation Points: 2,714 [?]
Q&As Helped to Solve: 953 [?]
Skill Endorsements: 31 [?]
Moderator
Featured
 
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()

snybhandari
Newbie Poster
4 posts since Jun 2013
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
Unverified Member
 
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 three months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article