Article View: borland.public.interbase.sql
Article #953Re: actual(Date1) - next(Date2)
From: WillR
Date: Thu, 22 Mar 2007 14:33
Date: Thu, 22 Mar 2007 14:33
54 lines
3671 bytes
3671 bytes
aleplgr wrote: > "Patrick Moloney" <NewsID*at*SandrockSoftware.c*o*m> wrote: >> aleplgr wrote: >> >>> "Patrick Moloney" <NewsID*at*SandrockSoftware.c*o*m> wrote: >>>> Why do you want to "return a table"? This sounds like you don't >>>> want separate client tables in Interbase? How many clients are >>>> there? Is that a lot of tables? >>>> >>>> -- >>>> Patrick Moloney >> It's hard understanding what you need to do. Each message you post >> gives a little more information about what you want. You also include >> bits of your proposed solution - tables etc. You would probably get a >> better response with less guessing by everyone if you put the effort to >> make a clear and complete statement of what you need to do, and leave >> out your suggestions for the solution in this step one. It is often >> said that asking the right question is more than half the answer. >> >> -- >> Patrick Moloney > > > OK, I didn't mean to be confusing. > I have a 3 columns table: ClientID, Date1 and Date2. > There are at most 1000 different ClientIDs and 10000 rows in this table, it's ordered by ClientID and Date1. > For each ClientID there's at least one pair (Date1,Date2) and at most 10 pairs (Date1,Date2). > I need to return one table with 2 columns: ClientID and Date1 where > if the difference between the actual Date1 and next(Date2) >30 return actual Date1 else if there is no such difference >30 return the greatest Date1 for the actual ClientID. > next(Date2) is the Date2 that is in the next row of the actual ClientID. > The DBMS is InterBase 7.5 But you also mentioned feeding SPSS -- Couldn't you use the Data Direct ODBC driver to query the data directly from Interbase? It does work -- I am feeding MapInfo from Interbase 7 -- directly via the ODBC driver. So it seems your description is still not complete. If there is more information to feed -- especially with calculations maybe a direct feed and some views are the best answer. If there is a lot of calculation maybe a client program is best... I looked at using Stored procedure to process our portable "magnetometer" data but then decided to use a Delphi routine since it became clear the logic was pretty tortuous and would become more so as we looked at more conditions to "flag" data. Then I present the data with the flags set and the geologist can map the conductors detected as they see fit. The flags define sets of data with specific conditions entitling them to pretty little symbols on the maps -- for example. -- Will R PMC Consulting
Technical Details
Message-ID:
<460293a8@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<4601ab4c$1@newsgroups.borland.com> <4601d64f$1@newsgroups.borland.com> <46024306$1@newsgroups.borland.com> <46027137$1@newsgroups.borland.com> <460281d1$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 114a0e,dd90eb1b1157ce03 X-Google-Attributes: gid114a0e,public X-Google-Language: ENGLISH,ASCII-7-bit Date: Thu, 22 Mar 2007 07:33:18 -0700 From: WillR <willrNo.Spam.pmccl.noSpam.com> User-Agent: Thunderbird 1.5.0.10 (Windows/20070221) MIME-Version: 1.0 Newsgroups: borland.public.interbase.sql Subject: Re: actual(Date1) - next(Date2) References: <4601ab4c$1@newsgroups.borland.com> <4601d64f$1@newsgroups.borland.com> <46024306$1@newsgroups.borland.com> <46027137$1@newsgroups.borland.com> <460281d1$1@newsgroups.borland.com> In-Reply-To: <460281d1$1@newsgroups.borland.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 189.174.182.44 Message-ID: <460293a8@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1174573992 189.174.182.44 (22 Mar 2007 07:33:12 -0800) Lines: 54 Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail