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

Crystal Query / What kind of query

Status
Not open for further replies.

mission2java

Programmer
Jul 3, 2001
129
US
In my database which is SQL Server..I have a table listing a 9 digit code...but the problem is management wants to be able to select a parameter of the last three digits of this 9 digit code. Plus the report needs to show the 9 digit code and the last three digits of this code seperatly. So do I create a stored procedure in SQL Server or do I create a query? Can I create a query...I mean how should I let crystal see this data? I cannot just tell it to use the table can I? Because I need specific things such as the three characters from the right side of that 9 digit code.

Jon
 
FOr Crystal 8.5, you can write a formula field saying something like
right({your.field}, 3)

This can be shown separately from the field itself, and even used for sorting etc.

Commands like left, right and mid are useful to snip a piece out of an account number etc.

Madawc Williams
East Anglia, Great Britain
 
Ya but...

How do I use this as a selection parameter...
should this be a table directly from SQL Server?

See my problem with crystal is Im not sure if its really dependent on the data source that much..I mean should this be a stored procedure or directly from the table?

JOn
 
The point about Crystal is to be a relatively simple 'front end' for data from SQL.

Madawc Williams
East Anglia, Great Britain
 
It can be directly from the table. Have a parameter field where the user will type the last 4 digits. Once done restrict the records to those having Account Nos ending with those 4 digits using a Formula.

Good Luck
Sri
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top