Question

How do I gather/pass multiple input parameters to SQL stored procedure?

Asked by: MTaft

Hello Experts,

I am writing a Crystal Report (in CRXI) that will explode the Bill of Materials for each part number entered by the user.  Additionally, the user wants to be able to prioritize the list of part numbers, and to enter a Build Quantity for each part number as well.

So my input parameters need to accommodate something like this:

Priority    PartNo     BuildQty
---------    -----------  ----------
2             m123        3
1             m234        2
3             m111        4

And then I need to feed the SQL stored procedure these values.  Right now, my stored procedure starts out looking like this:

ALTER PROCEDURE [dbo].[NC_SHORTAGES]
(@Priority int,
 @PartNum varchar(80),
 @BldQty int)

So when I run the report, it prompts for those three fields.  But I need to be able to enter multiple part numbers, with a priority and build quantity for each.

In the Code section below is my entire stored procedure.  I think I will have to change this a little as well to process multiple input part numbers, right?

I'm so very stuck.  Please let me know what other information I can provide.  Thank you!

ALTER PROCEDURE [dbo].[NC_SHORTAGES] 
(@Priority int,
 @PartNum varchar(80),
 @BldQty int)
 
    AS 
    BEGIN
        
        If IsNull(object_id('tempdb..##partqty'),0) <> 0 DROP TABLE ##partqty
        CREATE table ##partqty (level integer, seq integer,
                               parpart char(30), parrev char(12), 
                               chpart char(30), chrev char(12), 
                               pdesc char(50), reqqty integer, uom char(4),
                               typecd char(1), path char(40),
                               whse char(7), ohqty integer, 
                               allocqty integer, nonnetqty integer, 
                               avqty integer, onordr integer,
                               ppath char(50))
                               
		SET NOCOUNT ON
 
; WITH BOM AS (SELECT     0 AS LEVEL, 000 AS seq, part.partnum AS parent, revisionnum AS P_revisionnum, part.partnum, 
                          revisionnum AS C_revisionnum, partdescription, CONVERT(decimal(18, 8), 0) AS qty, ium, typecode, 
                          CONVERT(varchar(800), (CONVERT(varchar(2), @Priority) + part.partnum)) AS path
               FROM         part INNER JOIN
                                 NC_PARTREV2 ON part.partnum = NC_PARTREV2.partnum
               WHERE     part.partnum = @PartNum
                                    UNION ALL
               SELECT     B. LEVEL + 1, CONVERT(int, M.mtlseq), M.partnum, R.revisionnum, M.mtlpartnum, CR.revisionnum, 
                          P.partdescription, CONVERT(decimal(18, 8), M.qtyper), P.IUM, P.typecode, 
                          CONVERT(varchar(800), b.path + ',' + CONVERT(varchar(10), M.mtlseq))
               FROM         BOM B INNER JOIN
                                  PARTMTL M ON M.partnum = B.partnum INNER JOIN
                                  NC_PARTREV2 R ON R.partnum = B.partnum AND M.revisionnum = R.revisionnum INNER JOIN
                                  PART P ON P.partnum = M.mtlpartnum INNER JOIN
                                  NC_PARTREV2 CR ON CR.partnum = P.partnum)
    
                         
   INSERT INTO ##partqty
     (level, seq, parpart, parrev, chpart, chrev, pdesc, reqqty, uom, typecd, path, whse, ohqty, 
             allocqty, nonnetqty, avqty, ppath)
     SELECT     LEVEL, seq, parent, P_revisionnum, bom.partnum, C_revisionnum, partdescription, 
                (@BldQty * qty) AS QtyNeeded, ium, typecode, path, warehousecode, onhandqty, allocqty, 
                nonnettableqty, (onhandqty + nonnettableqty - allocqty), path
     FROM       BOM INNER JOIN
                partwhse ON bom.partnum = partwhse.partnum
     ORDER BY path
   
select * from ##partqty order by ppath;
	END
	RETURN

                                  
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:

Select allOpen in new window

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2009-09-22 at 08:37:29ID24751903
Tags

input parameters

,

stored procedure

Topics

Crystal Reports Software

,

SQL Server 2005

Participating Experts
2
Points
500
Comments
6

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. motherboard exploded
    I wasn't paying attention to what I was doing and plugged the ps2 keyboard into the mouse ps2 port and the ps2 mouse into the ps2 keyboard port. The thing exploded. Fryed the Motherboard and CPU and even managed to kill the hard drive and cdrom drive. The video card and NIC a...
  2. Bill Of Material
    I am looking for some example code to explode a multi level Bill Of Material. My Table structure is as Follows: ParentID ChildID Level An Individual BOM might have several levels. I need one that will work with either Access or SQL Server. Any examples of a r...
  3. Line feed in varchar column
    Hi There is a description field in one of the tables that has user input line feed. I need sql command to detect which columns in that table has line feed and also try to eliminate it. Can you guys let me know how to do this?
  4. varchar(8000) limits,how to overcome it in storedpro…
    Hello Expert, I face problem where my varchar stores data which over 8000 char. So i cant execute my storedprocedure. got error May i know how to overcome this varchar(8000) limits? The Following is my storedprocedure : set ANSI_NULLS ON set QUOTED_IDENTIFIER ON go...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: mlmccPosted on 2009-09-22 at 16:56:16ID: 25398816

To be able to do that you will have to do it in an application.  Crystal really doesnt have the ability to handle multiple parameters with multiple values.

You could do a single multiple parameter like the part number as

{PartNumberField} IN {?PartumberParm}

But to associate PartNumber1 with priority and build quantity will require an application to associate the values.

mlmcc

 

by: James0628Posted on 2009-09-22 at 23:26:12ID: 25400445

There is no way to pass a CR multi-value parameter to a SQL stored procedure.  To pass multiple values, there are a few basic options:

 1) Use a single value string parameter and have the user enter the multiple values in one string (eg. "1,2,3").  Then the procedure would have to interpret the string parameter to get the individual values.

 2) If you are not using any subreports, you could make your current report a subreport, have the main report accept the multi-value parameter and then convert that to a string, and pass that string to a single-value string parameter in the subreport, which would then be passed along to the stored procedure.  As above, the stored procedure would then have to interpret the string to get the individual values.  The difference between this and option #1 is that with this option you're using a multi-value parameter in the report, rather than forcing the users to combine the values in one parameter (in a string like "1,2,3").  But a subreport can not contain a subreport, so this option is not available if your report needs any subreports.

 3) Actually use multiple parameters in your stored procedure, one for each possible parameter value.  Something like:

@Priority1 int,
@Priority2 int,
@Priority3 int,
@PartNum1 varchar(80),
@PartNum2 varchar(80),
@PartNum3 varchar(80),
@BldQty1 int,
@BldQty2 int,
@BldQty3 int

 Not pretty, but it is, technically, an option.


 If you have more than one parameter that allows multiple values and you have to associate the values from each parameter, so that the first value in parameter A is associated with the first value in parameter B, and so on, that complicates things a bit further, but if it's a simple one-to-one relationship and you assume that the values are always entered in the same relative order (so that you're associating value 1 with value 1, value 2 with value 2, etc.), then I don't see that as a big problem.

 James

 

by: MTaftPosted on 2009-09-23 at 05:56:57ID: 25402517

Thanks guys.  James0628, I think I'll end up going with your option # 3.  It's the most straightforward and my users aren't going to need to enter thousands of these by any means.  Definitely not more than 10 on any given run.

Do you know how I'd change the SQL stored procedure to use those new input parameters?  

 

by: James0628Posted on 2009-09-23 at 07:48:14ID: 25403717

10 of each parameter seems like an awful lot of parameters to me.

 As for changing the procedure, I'm not sure, because I'm not sure that I fully understand what it's doing, but here are my thoughts.

 First of all, since you'll now have a bunch of "optional" parameters, you'll have to decide how to handle that.  You'll presumably want to set some default value for the parameters in the report.  It will either need to be some value that will never return any results, or a value that you specifically check for in the procedure.  @PartNum seems to be the driving force, so that may be the parameter that you need to focus on (eg. have the default for that be a value that will never be found in part.partnum).

 For @Priority and @PartNum, it looks like you basically need to repeat what lines 22 - 27 do for each pair of parameter values.  The most straightforward approach may be to simply repeat those lines for each pair of parameters.  Something like the following.  The only difference in each SELECT is which @PriorityX and @PartNumX parameters it uses.

; WITH BOM AS (
SELECT     0 AS LEVEL, 000 AS seq, part.partnum AS parent, revisionnum AS P_revisionnum, part.partnum,
                          revisionnum AS C_revisionnum, partdescription, CONVERT(decimal(18, 8), 0) AS qty, ium, typecode,
                          CONVERT(varchar(800), (CONVERT(varchar(2), @Priority1) + part.partnum)) AS path
               FROM         part INNER JOIN
                                 NC_PARTREV2 ON part.partnum = NC_PARTREV2.partnum
               WHERE     part.partnum = @PartNum1
                                    UNION ALL
SELECT     0 AS LEVEL, 000 AS seq, part.partnum AS parent, revisionnum AS P_revisionnum, part.partnum,
                          revisionnum AS C_revisionnum, partdescription, CONVERT(decimal(18, 8), 0) AS qty, ium, typecode,
                          CONVERT(varchar(800), (CONVERT(varchar(2), @Priority2) + part.partnum)) AS path
               FROM         part INNER JOIN
                                 NC_PARTREV2 ON part.partnum = NC_PARTREV2.partnum
               WHERE     part.partnum = @PartNum2
                                    UNION ALL
SELECT     0 AS LEVEL, 000 AS seq, part.partnum AS parent, revisionnum AS P_revisionnum, part.partnum,
                          revisionnum AS C_revisionnum, partdescription, CONVERT(decimal(18, 8), 0) AS qty, ium, typecode,
                          CONVERT(varchar(800), (CONVERT(varchar(2), @Priority3) + part.partnum)) AS path
               FROM         part INNER JOIN
                                 NC_PARTREV2 ON part.partnum = NC_PARTREV2.partnum
               WHERE     part.partnum = @PartNum3
                                    UNION ALL

 and so on for parameter pairs 4, 5, 6, etc.


 In theory, I think you could do essentially the same thing using CASE, but there is one difference.  If the same value could be used in more than one @PartNumX parameter (eg. @PartNum1 and @PartNum5 had the same value), the approach above would repeat that part once for each matching parameter, using a different @PriorityX parameter value each time (eg. @Priority1 the first time and @Priority5 the second time).  OTOH, the approach below would just include that part once, using the @PriorityX value that corresponded to the first matching @PartNumX (@Priority1 in the above example).

 Using CASE there would just be one SELECT:

; WITH BOM AS (
SELECT     0 AS LEVEL, 000 AS seq, part.partnum AS parent, revisionnum AS P_revisionnum, part.partnum,
                          revisionnum AS C_revisionnum, partdescription, CONVERT(decimal(18, 8), 0) AS qty, ium, typecode,
                          CONVERT(varchar(800),
 (CONVERT(varchar(2),
 CASE part.partnum
  WHEN @PartNum1 THEN @Priority1
  WHEN @PartNum2 THEN @Priority2
  WHEN @PartNum3 THEN @Priority3

   and so on for parameter pairs 4, 5, 6, etc.

 END -- End of the CASE statement
) + part.partnum)) AS path
               FROM         part INNER JOIN
                                 NC_PARTREV2 ON part.partnum = NC_PARTREV2.partnum
               WHERE     part.partnum IN (@PartNum1, @PartNum2, @PartNum3,
 and so on for the remaining @PartNumX parameters )
                                    UNION ALL


 As for @BldQty, you could theoretically use a similar CASE statement there (with the same caveat about two or more @PartNumX parameters having the same value).  Change line 43 to:

(CASE bom.partnum
  WHEN @PartNum1 THEN @BldQty1
  WHEN @PartNum2 THEN @BldQty2
  WHEN @PartNum3 THEN @BldQty3

   and so on for parameter pairs 4, 5, 6, etc.

 END -- End of the CASE statement
 * qty) AS QtyNeeded,
                ium, typecode, path, warehousecode, onhandqty,


 Like I said, I'm not sure that I fully understand what your procedure is doing, so some, or all, of this may be wrong, but it _seems_ reasonable.

 James

 

by: MTaftPosted on 2009-09-24 at 07:32:06ID: 25413723

James, your solution got me thinking, and I ended up doing it a different way.  Since you were the catalyst for this thought process, I'm definitely giving you the points.  Thanks!

ALTER PROCEDURE [dbo].[NC_SHORTAGES] 
(@Priority1 AS int = NULL,
 @Priority2 AS int = NULL,
 @Priority3 AS int = NULL,
 @Priority4 AS int = NULL,
 @Priority5 AS int = NULL,
 @PartNum1 AS varchar(80) = NULL,
 @PartNum2 AS varchar(80) = NULL,
 @PartNum3 AS varchar(80) = NULL,
 @PartNum4 AS varchar(80) = NULL,
 @PartNum5 AS varchar(80) = NULL,
 @BldQty1 AS int = NULL,
 @BldQty2 AS int = NULL,
 @BldQty3 AS int = NULL,
 @BldQty4 AS int = NULL,
 @BldQty5 AS int = NULL)
 
    AS 
    BEGIN    
	  SET ANSI_NULLS ON;
        If IsNull(object_id('tempdb..##partqty'),0) <> 0 DROP TABLE ##partqty;
        
        CREATE table ##partqty (line_no integer, level integer, seq integer,
                                 parpart char(30), parrev char(12), 
                                 chpart char(30), chrev char(12), 
                                 pdesc char(50), reqqty integer, uom char(4),
                                 typecd char(1), path char(40),
                                 whse char(7), ohqty integer, 
                                 allocqty integer, nonnetqty integer, 
                                 avqty integer, onordr integer);
 
        DECLARE @test int,
                @UsePrio int,
                @UsePart varchar(80),
                @UseQty int;
                    
        SET @test = 1;
        WHILE @test < 6
        BEGIN    
  		  IF (@test = 1 and (@Priority1 IS NULL OR
		                     @PartNum1  IS NULL OR
		                     @BldQty1   IS NULL)) OR
             (@test = 2 and (@Priority2 IS NULL OR
		                     @PartNum2  IS NULL OR
		                     @BldQty2   IS NULL)) OR
		     (@test = 3 and (@Priority3 IS NULL OR
		                     @PartNum3  IS NULL OR
		                     @BldQty3   IS NULL)) OR
		     (@test = 4 and (@Priority4 IS NULL OR
		                     @PartNum4  IS NULL OR
		                     @BldQty4   IS NULL)) OR
		     (@test = 5 and (@Priority5 IS NULL OR
		                     @PartNum5  IS NULL OR
		                     @BldQty5   IS NULL))                                                          		                     
		  BEGIN
		    SET @test = @test + 1;
		    CONTINUE;
		  END;  
		  ELSE 
		  BEGIN
 
		    SET @UsePrio = CASE @test 
		                        WHEN 1 THEN @Priority1
		                        WHEN 2 THEN @Priority2
		                        WHEN 3 THEN @Priority3
		                        WHEN 4 THEN @Priority4
		                        WHEN 5 THEN @Priority5
		                   END;
 
		    SET @UsePart = CASE @test 
		                        WHEN 1 THEN @PartNum1
		                        WHEN 2 THEN @PartNum2
		                        WHEN 3 THEN @PartNum3
		                        WHEN 4 THEN @PartNum4
		                        WHEN 5 THEN @PartNum5
		                   END;
 
		    SET @UseQty  = CASE @test 
		                        WHEN 1 THEN @BldQty1
		                        WHEN 2 THEN @BldQty2
		                        WHEN 3 THEN @BldQty3
		                        WHEN 4 THEN @BldQty4
		                        WHEN 5 THEN @BldQty5
		                   END;
		    SET @test = @test + 1;
		  END;
		
		  SET NOCOUNT ON;
 
     
; WITH BOM AS (SELECT     0 AS LEVEL, 000 AS seq, part.partnum AS parent, revisionnum AS P_revisionnum, 
                          part.partnum, revisionnum AS C_revisionnum, partdescription, CONVERT(decimal(18, 8), 0) AS qty, 
                          ium, typecode, CONVERT(varchar(800), CONVERT(varchar(800), @UsePrio) + part.partnum) AS path
               FROM         part INNER JOIN
                                 NC_PARTREV2 ON part.partnum = NC_PARTREV2.partnum
               WHERE     part.partnum = @UsePart 
                                    UNION ALL
               SELECT     B.LEVEL + 1, CONVERT(int, M.mtlseq), M.partnum, R.revisionnum, M.mtlpartnum, CR.revisionnum, 
                          P.partdescription, CONVERT(decimal(18, 8), M.qtyper), P.IUM, P.typecode, 
                          (CONVERT(varchar(800), b.path + ',' + CONVERT(varchar(800), M.mtlseq)))
               FROM         BOM B INNER JOIN
                                  PARTMTL M ON M.partnum = B.partnum INNER JOIN
                                  NC_PARTREV2 R ON R.partnum = B.partnum AND M.revisionnum = R.revisionnum INNER JOIN
                                  PART P ON P.partnum = M.mtlpartnum INNER JOIN
                                  NC_PARTREV2 CR ON CR.partnum = P.partnum)
 
                         
   INSERT INTO ##partqty
     (level, seq, parpart, parrev, chpart, chrev, pdesc, reqqty, uom, typecd, path, whse, ohqty, 
             allocqty, nonnetqty, avqty)
     SELECT     cast(LEVEL as int), cast(seq as int), cast(parent as char), 
                cast(P_revisionnum as char), cast(bom.partnum as char), cast(C_revisionnum as char), 
                cast(partdescription as char), cast((@UseQty * qty) as int), 
                cast(ium as char), cast(typecode as char), cast(path as char),
                cast(warehousecode as char), cast(onhandqty as int), cast(allocqty as int), 
                cast(nonnettableqty as int), cast((onhandqty + nonnettableqty - allocqty) as int)
     FROM       BOM INNER JOIN
                partwhse ON bom.partnum = partwhse.partnum
     ORDER BY path;
     
     END; --WHILE 
   		    	
     UPDATE tblPOOLS p WITH (READPAST)
     SET LOCKED = 'TRUE'
     WHERE p.somepoolsfield IN  (SELECT TOP (5) t.somefield FROM tblTABLE t WHERE t.STAGECODE = 'AT' ORDER BY STAGEDDATE)
 
     select line_no = @counter + 1 = @counter, level, seq, parpart, parrev, chpart, chrev, pdesc, reqqty, uom, typecd, path, whse, ohqty, 
             allocqty, nonnetqty, avqty from ##partqty order by path;
	END
	RETURN
                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:

Select allOpen in new window

 

by: James0628Posted on 2009-09-25 at 21:08:49ID: 25428773

Yeah, that's another way to go.  The loop stuff complicates things a bit, but it does simplify the main part of the code, which is nice.

 Glad you were able to work it out.

 James

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...