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

Arrays & Record Types 1

Status
Not open for further replies.

lespaul

Programmer
Feb 4, 2002
7,083
US
Hello all! I wanted to make sure that what I want to do is possible before trying for days just to find out it's not possible!

I have been looking into the best way to extract data from my database, manipulate it and then have an array with all the information I need in the proper order.

So, here's what I'd like to try:
Create a record with the final information structure (ps where does the type declaration of a record get placed?)
Create an array that holds the record.

If I do this, could I still access the individual 'fields' of the record? How would I do that?

Here is what I'm trying to do (in case the above won't work or there is a better way to accomplish my goal):
I query my database and get PANELID, LASTNAME, FIRSTNAME ORDER BY PANELID;
PANELID = (MMDDYYP0#J##) where the P0# indicates which panel the person is assigned to and the J## indicates the juror number of the person
Then I need to break the PANELID into two pieces: the panel # and the juror #;
Then I need to print the Panel List. The panel list needs to be formatted with 1 panel in a column and the lastname, firstname - J## (in alpha order) of all the people in that panel, 2nd column = 2 panel, etc.
So I was thinking of a record for each person with required information and then an array of the records.

Whatcha think??

Thanks for any assistance and suggestions.


Leslie
landrews@metrocourt.state.nm.us

SELECT * FROM USERS WHERE CLUE > 0
No Rows Returned
 
I don't think you need to get into arrays. You can simply run a query picking up the fields you want and ordering them the way you want.
As for splitting PANELID, you can use SUBSTRING.
So "SELECT SUBSTRING(PANELID,7,3) FROM TABLE" would return the "P0#" party of the PANELID for each record.

Hope this helps.
 
thanks for the response, but I actually got it to work the way I wanted! I created a record type of JurorRecord, with the fields of Lastname, firstname, panelid, jurorid and each record is an array slot. Then I go through the array and separate each panel into a column in Excel (panel 1 to the first column, panel 2 to the second, etc) then sort each column by name and I have the list exactly the way I need it!

Leslie
landrews@metrocourt.state.nm.us

SELECT * FROM USERS WHERE CLUE > 0
No Rows Returned
 
Glad you got what you wanted Leslie.
There's more than one way to skin a cat, as the saying goes. For myself, I like to stretch the possibilities of SQL and it is amazing what you can do when you dig around!

Peter
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top