Subject Re: SQL stop sorting at middle of table
From Keith <drkwchan@outlook.com>
Date Fri, 04 Jan 2019 18:49:42 -0500
Newsgroups dbase.getting-started

Mervyn Bick Wrote:

> On 2019-01-03 3:49 PM, Keith wrote:
>
> > Thx Mervyn for your help.
> > Your codes generated the same result.
> > I check the content of Condate and found it is stored as "dd/mm/yyyy".
> > Would this affect the count?
> > Much appreciation for your help and as newbies I am studying your code line by line.
> > Best regards
>
>
> If condate is a date field than any value will be stored internally as a
> date.  The value will be displayed in what ever format has been set for
> dBASE.  If you  SET DATE TO BRITISH  in a program or from the Command
> Panel the date will display as dd/mm/yyyy while SET DATE TO AMERICAN
> will cause the date to display as mm/dd/yyyy. See the help file for
> other settings.
>
> localSQL requires dates in a SQL SELECT statement to be literal values
> in either 'mm/dd/yyyy' (American) or 'dd.mm.yyyy' (German) format no
> matter what format is set for the date.
>
> If condate is a date field the code I posted should work.  If condate is
> a character field then this will explain why the code (both yours and
> mine) isn't working properly.
>
> Please check the field type for condate and let me know what it is.  If
> it is a character the code needs to be adjusted.  If it is a character
> field you will need to make sure you have used the same format for all
> records.
>
> Perhaps the easiest way to do this is, in the Command Panel, enter the
> following.
>
> use consults
> display structure
> use
>
> While you're at it  ? set("date")  in teh Command Panel will give you
> the setting for the date format in dBASE.
>
> Mervyn.
>

Hi Mervyn,
Condate is a date field and your codes work very beautifully.
However the Last_consult shows as 02/28/2018.
Please teach me how to check the contents of condate.
Much thanks....
Keith