HP3000-L Archives

May 1995, Week 1

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Tom Stelter <[log in to unmask]>
Reply To:
Tom Stelter <[log in to unmask]>
Date:
Mon, 1 May 1995 17:20:00 PDT
Content-Type:
text/plain
Parts/Attachments:
text/plain (38 lines)
Can whomever originated this memo please respond with their email address.
 Thanks, Tom Stelter at [log in to unmask]  TIA
 ----------
From: owner-hp3000-l
To: Multiple recipients of list HP3000-L
Subject: Queries with Visual Basic and Image Sql
Date: Wednesday, April 05, 1995 8:18PM
 
I have a couple questions about Visual Basic and Image Sql. I'm fairly new
to both.
 
I'm using Visual Basic to access Image databases via ODBC. The set I'm
using is called Trans and contains 100,000 records. Each  transaction has
an amount, date and account type, etc..
 
The first thing I need to do is sum all amounts for the year 1994. I used
db.createsnapshot(select sum (amt) as charges from trans where
mid$(modayr,5,2) = '94').
 
The second thing I need to do, for each distinct account type (select
distinct account_type from trans) I need to sum the charges that were
billed in 1994. I currently cycle though each account type with this
statement db.createsnapshot(select sum (amt) as item1 from trans where
account_type = '?' and mid$(modayr,5,2)='94') (? being account type)
 
The above example took 2 Hours 45 Min on a 937 with 30 account types.
 
The problem with the above, as I see it, is out of the 100,000 records in
the trans set maybe 5,000 records are for 1994. Each time I cycle though
to sum the account types, I look though 100,000 records instead of the
5,000.
 
What I think I'd to do is create a Snapshot of the transactions for 1994,
then do all my account type queries on that snapshot. I've tried just
about everything I can think of.
 
Thanks for any Help!

ATOM RSS1 RSS2