Re: arrrggghhh!! Select statements..



Note also the BETWEEN(date, sdate, edate) is an Xbase function. The SQL
version is
date BETWEEN sdate AND edate
Both work in VFP but as soon as you start communicating with other SQL
databases, only the SQL version works.

-Anders

"Emily" <Emily@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:7052B481-FCD0-4F47-B45F-46F3726E3264@xxxxxxxxxxxxxxxx
OH THANK YOU VERY MUCH



"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: Import Access records to excel (parameter is a called funct)
    ... I assume you need to return the variables sDate and eDate to the calling ... >> You need to understand that your .mdb file is a Jet database. ... >> functions nor the UDF functions in an Excel workbook. ...
    (microsoft.public.excel.programming)
  • Problem with query taking a long time.
    ... I have a large SQL table, called Event, that has 4.6 million records in it. ... WHERE SeqNo NOT IN (SELECT TOP 0 SeqNo FROM vw_HistEventDisplayGrid ... ORDER BY NAME ASC, EDATE DESC) ...
    (microsoft.public.sqlserver.programming)
  • VBA Dates help
    ... Dim sdate As Date ... Dim edate As Date ... Dim wknumtot As Integer ...
    (microsoft.public.excel.programming)
  • Re: text & date criteria
    ... Tblcard_use is a table which contains card use history, ... sdate & edate represent the start date and end date for the period the card ... I want dcount to count where Idate falls between sdate ...
    (microsoft.public.access.modulesdaovba)
  • Re: text & date criteria
    ... What are sdate and edate? ... > Hello Jeff ...
    (microsoft.public.access.modulesdaovba)