The BETWEEN a AND b syntax should work fine in VFP as it's standard SQL, and yet leave it agnostic in case you need to use it against a different backend later.

As for the OP's code below:
>> I get the [unrecognized command] error with this:
>>
>>    SELECT Gluctmp1.date, COUNT(Gluctmp1.amount);
>>      FROM Gluctmp1;
>>      WHERE ;
>>         Gluctmp1.category = "Glucos";
>>             Gluctmp1.date BETWEEN Gluctmp1.date AND (Gluctmp1.date +
>> 20) ;
>>      GROUP BY Gluctmp1.date

...looks like he's just missing the AND word between his 2 where conditions. It should be:
>>      WHERE ;
>>         Gluctmp1.category = "Glucos";
>> AND Gluctmp1.date BETWEEN Gluctmp1.date AND (Gluctmp1.date + 20) ;

--Mike



On 5/1/2013 4:30 PM, Kevin Cully wrote:
If this is a VFP select statement, then try this out.

LOCAL ldStartDate, ldEndDate
ldStartDate = DATE()-20
ldEndDate = DATE()

SELECT Gluctmp1.date, COUNT(Gluctmp1.amount);
      FROM Gluctmp1;
      WHERE ;
         Gluctmp1.category = "Glucos";
           AND BETWEEN( Gluctmp1.date, ldStartDate, ldEndDate ) ;
      GROUP BY Gluctmp1.date ;
      ORDER BY Gluctmp1.date ;
      INTO CURSOR c_Gluctmp1

On 05/01/2013 04:25 PM, Charles Hart Enzer, M.D., FAACP wrote:
Dear Ted:

Thank you for replying.

I am trying to get aTable  of "amount"s over a 21 day period.

I think that the problem is theEnddate:
Gluctmp1.date + 20

Even though [Gluctmp1.date + 20] is a valid date, SELECT

I get the [unrecognized command] error with this:

   SELECT Gluctmp1.date, COUNT(Gluctmp1.amount);
     FROM Gluctmp1;
     WHERE ;
        Gluctmp1.category = "Glucos";
            Gluctmp1.date BETWEEN Gluctmp1.date AND (Gluctmp1.date +
20) ;
     GROUP BY Gluctmp1.date


[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to