Re: arrrggghhh!! Select statements..



Gene was right - I didn't have too much time to analyze the select but you
can do what Gene said all in one select. There is no need to use one
followed by another. It's kind of hard for me to know exactly how to do the
select without knowing what fields rptrnum and invonum are in what tables
but if those keys are in both the payment and invlines table then you would
use both like this:

select * from payment,invlines ;
where payment.invonum = invlines.invonum and ;
payment.rptrnum = invlines.rptrnum .and. ;
Between(payment.pmt_date,sdate,edate) ;
order by invo_num into cursor Temp1

Note that Between() is a function

Mike


"Emily" <Emily@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:38CAFB57-1394-4412-B343-34E1D2132A3B@xxxxxxxxxxxxxxxx
THIS DID IT. Can you explain if it isn't too much trouble why it does
this?
I just want to understand instead of just following blindly.

And sorry about the font, yes it does look aligned here. I will keep this
in mind next time I have to do this again.



"Gene Wirchenko" wrote:

Emily <Emily@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

I am not sure why I can't get my select to work.

this is what I am doing

select *,pmt_date as pmtdate from payment ;
where payment.pmt_date between sdate and edate
order by invo_num into dbf (dir_temp+'temp1.dbf')

select * from temp1,invlines ;
where temp1.invo_num=invlines.invo_num into dbf
(dir_temp+'temp2b.dbf')

This is doing what you tell it to. When invo_num matches,
select.

I am guessing that your where clause expression should be
temp1.invo_num=invlines.invo_num and
temp1.rptrnum=invlines.rptrnum

[snip]

invlines looks like this

invonum linenum rptrnum product amount
100 1 15 a $50
100 2 15 b $150
100 3 29 c $500
100 4 29 d $200

It would be easier to read if the columns lined up. They might
for you; they do not for me. Using a fixed-width font is best. I
almost gave the wrong columnname, because 15 looks to be under
product.

[snip]

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.



.



Relevant Pages

  • Re: Linux 2.6.15-rc2
    ... Gene has sent me a copy of his .config ... ... do you have v4l-kernel cvs installed on top of kernel 2.6.15-rc2? ...
    (Linux-Kernel)
  • Re: increase in information represented by DNA
    ... And what happens when such a gene does get expressed again and actually ... A series of alterations that conserves a gene's ... How does this work for polyploidy speciation? ...
    (talk.origins)
  • Re: increase in information represented by DNA
    ... then produce a definition of "fitness" ... And what happens when such a gene does get expressed again and actually ... A series of alterations that conserves a gene's ...
    (talk.origins)
  • Re: increase in information represented by DNA
    ... A' while gene B produces protein B'. ... A point mutation that makes an enzyme react ...
    (talk.origins)
  • Re: recombination question
    ... understandable as a random process for the 22 Somatic Chromosomes. ... My understanding is that the X crosses over in women (who have two of ... only the "common" gene area's in the X&Y crossover ...
    (sci.bio.evolution)