Solved

Need to build a Crystal Reports or SQL select statement from a set of numbers in EXCEL.

Posted on 2015-02-04
7
270 Views
Last Modified: 2015-02-05
How Can I combine a column of numbers in EXCEL to one cell, comma separated?

I have to build a select statement in Crystal that includes over 100 sets of numbers, in this format
and {RPTOBS.HDID} in [53,54,9836,2540]. They are currently sitting in an Excel document in one column, 1746 rows long.

If someone knows a better way to ask the database for these values, I am open to suggestions.
0
Comment
Question by:Becky Edwards
7 Comments
 
LVL 1

Expert Comment

by:maqskywalker
ID: 40589162
Do you use your crystal report as a stand alone crystal report? or within a Windows Forms? or Web Application?

Also, do you plan to use a database like Sql Server , Oracle or MySQL or do you just want to read the data straight from the excel spreadsheet?
0
 
LVL 18

Assisted Solution

by:vasto
vasto earned 250 total points
ID: 40589175
0
 
LVL 100

Accepted Solution

by:
mlmcc earned 250 total points
ID: 40589235
I don't believe you will be able to do it with the IN statement.  I believe there is a limit to the number of values in a the list.  

Crystal will treat the list of values inside the [ ] as an array so you are limited to 1000 values.

You could add a data source for the Excel sheet to the report then INNER JOIN it to the report datasource on the appropriate field.

mlmcc
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:Becky Edwards
ID: 40589432
Do you use your crystal report as a stand alone crystal report? YES

you just want to read the data straight from the excel spreadsheet? YES, I will try to work on adding the data source and see if I can figure that out.
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 40589452
If you need help just ask.

mlmcc
0
 

Author Closing Comment

by:Becky Edwards
ID: 40589775
Both answers were very helpful in determining the best solution.  Thank you all for your fast response!!!!!
0
 
LVL 34

Expert Comment

by:James0628
ID: 40590816
FWIW ...

 If you're going to link an Excel file to a db table, the performance could be an issue.  Trying to do random reads on an Excel file can be really slow.  You might be able to avoid that problem by using a query in the db to read the Excel file into an indexed temporary table or table variable, and then Join the main table with that, instead of the Excel file.  If, by chance, the values in the Excel file are static, or don't change often, you could copy them into a "permanent" table, and then update that table as necessary.

 James
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone 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

Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
I recently went through setting up a JasperReports Server using the AWS EC2 instance, and this article will cover some basic administration tasks I had to perform.
Viewers will learn various types of data validation for different data types in Excel 2013.
Viewers will learn the basics of the new Quick Analysis feature in Excel 2013.

856 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