Combining Data from two databases

Results 1 to 2 of 2

Thread: Combining Data from two databases

  1. #1
    John Rodgers Guest

    Default Combining Data from two databases

    I am building a time entry application. The time entry screen allows users to enter time against various activity types (projects, support issues, misc.). In order to constract the page, I need to pull all activites (based on User ID) from a preferences database, then pull any records from the time entry database (based on User ID and date), combined the two sets of data, eliminate any redundant records (keeping the record from the time entry DB), sort the data by activity type and refence number, and then output to the screen in sections (based on the activity type). <BR><BR>I&#039d like to use an multidimensional array but can&#039t find any good resources on the web for how to set it up. Here&#039s what the array would look like:<BR><BR>Activity_Type &#124 Activity_Ref &#124 Hours<BR>PROJ &#124 123 &#124 2.5<BR>SUPP &#124 4 &#124 .35<BR>MISC &#124 20 &#124 5.5 <BR><BR>Here&#039s some psuedo-code that show what I&#039m trying to do:<BR>----------------<BR>SELECT Activity_Type, Activity_Ref FROM Prefs WHERE User_ID = "john"<BR> Load values in Activity_Type and Activity_Ref into Array<BR>Loop until Pref.eof<BR><BR>Select Activity_Type, Activity_Ref, Hours FROM Time_Entries WHERE User_ID = &#039john&#039 AND Date = 04/06/00<BR> If this Activity Type and Reference already exist in the array<BR> move Hours into array <BR> Else<BR> Add Activity_Type, Activity_Ref and Hours into Array<BR>Loop until Time_Entries.eof<BR><BR>Sort array based on Activity_Type and Activity_Ref<BR><BR>Output to page<BR>---------------------<BR><BR>I&#039m stuck on everything except the output part. Can anyone suggest some good online resources for loading and sorting multidimesional arrays in VBscript? <BR><BR>Thanks,<BR><BR>John Rodgers<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Combining Data from two databases

    Depening on the type of database you are using, but you could try a hetrogenus (I think thats how you spell it) query, this would save using a multidimensional array<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts