Solved

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

Posted on 2015-02-04
7
277 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 101

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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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 101

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 35

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Hi, I am very much excited today since I'm going to share something very exciting Tool used for Analytical Reporting and that's nothing but MICROSTRATEGY. Actually there are lot of other tools available in the market for Reporting Such as Co…
Viewers will learn how to find and create templates in Excel 2013.
Viewers will learn the basics about Excel 2013’s new Flash Fill feature.

688 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