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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

selection formula problems

Status
Not open for further replies.
Oct 15, 2003
145
US
I want to get certain data on a report based on a date - however the date was not captured in my database as a date - but as part of a text string. If I do a SQL statement in SQL Server like this:

Select *
from Table
WHERE (field LIKE 'ACC-06__04%')

I get what I want...

but when I have this in my code:

crvreport1.SelectionFormula = "{table.field} LIKE 'ACC-06__04%'"

the report comes up blank. What am I doing wrong? Any thoughts?

I know that the rest of my code is correct - because it's only when I try to set the selection formula to the above - does it get screwy. I'm using Crystal Reports for .Net and VB .NET.

Thanks in advance.
 
I think in this case your underscores need replacing with question marks - one question mark for every character missing. Also I think in Crystal you put double quotes around the string.
 
Thanks - I changed it to have question marks instead of underscores and an asterix instead of a percent and now it works...

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top