Solved

Crystal Reports Record Select using Starts With Parameter

Posted on 2014-01-10
6
2,387 Views
Last Modified: 2014-01-16
Is it possible to have a Record Select using a "Starts With" pattern from a parameter prompt?

My Order Numbers have multiple Job Numbers associated, example:
OrderNo: 110954
JobNo: 110954-01, 110954-02, 110954-03, 110954-04... 110954-25
The "-" dash numbers represent subassemblies related to the OrderNo and master job "-01

The range of job numbers can vary so it may be easier to prompt for OrderNo and select all relative JobNo, rather than a prompting for a range of  JobNo.
0
Comment
Question by:Lee Ingalls
  • 2
  • 2
  • 2
6 Comments
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 39772300
Sure.  Just remember the selection may come to the user rather than being done on the server

{JobNoField} STARTSWITH {?OrderNo}

It might be better to use left

Left({JobNumberField},6) = {?OrderNo}

Can you build a query/view/sp in the database?
Can you use a command for the report rather than using tables?

mlmcc
0
 
LVL 8

Author Comment

by:Lee Ingalls
ID: 39772424
I needed to add a table to the Billing Rate Hours subreport for an OrderNo field. I made it a LEFT OUTER from OrderDet to TimeTicketDet... I'd say your specifying the LEFT in the formula gives me more flexibility (should I need it) by keeping the join an INNER?

The Data Source is MS SQL Server. We've recently changed how we process Orders/Jobs through our ERP -- from Job to Order specific. The canned reports prompt for JobNo and I'm attempting to re-purpose them to OrderNo prompts to include all related JobNo's.

I'm sure I could create some SQL VIEWS via the SQL Mgt Studio. I use queries for a number of Excel solutions. The others I hadn't considered; but I'm a willing student.

BudELee
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 39772619
Creating a view would allow you to convert the Job Number to drop the last several characters.  It could then be compared directly to the order number parameter.  You could also link the tables to gether.

mlmcc
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 35

Expert Comment

by:James0628
ID: 39773214
Lee,

 You seem to be suggesting that using the Left function, instead of startsWith, would give you "more flexibility".  I don't really see that (they basically do the same thing), but maybe that's not what you meant.

 I'm also not sure how either of them would affect whether you use a Left Outer Join or an Inner Join, but I guess that might depend on why you're using a Left Outer Join.

 James
0
 
LVL 8

Author Closing Comment

by:Lee Ingalls
ID: 39783499
mlmcc, thank you; it worked as described.

James0628 I appreciate the feedback... I was mis-speaking my thought on mlmcc's use of the Left({JobNumberField},6) = {?OrderNo} in teh select forumula and interrepting that as being an alternative to my setting the additional table linkage specifically to LEFT OUTER join.
0
 
LVL 35

Expert Comment

by:James0628
ID: 39785178
OK.  I was just confused, and was trying to make sure that there wasn't more going on than we realized.

 James
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question