Subject Re: (no subject)
From Bruce Beacham <bbeacham@no-plm-lowman.co.uk>
Date Sat, 3 Apr 2021 10:51:52 +0100
Newsgroups dbase.getting-started

On 01/04/2021 09:25, Shannon Lee Alberts wrote:
> A summary of the problem, all records display correctly but when
> using a simple function like SUM, the records with the year 2026 are
> not counted, even though there are no conditions or filters that
> would trigger that.

<snip>

> issue seems to occur in each and every single one of them, even the
> new ones.

Then there must be a common engine for selecting the rows to be summed
or reported.   Tha's the code which is of interest.

If there is any selection on the date field, is it done in sql or by way
of a rowset.filter or rowset.cangetrow?

A selection expressed in the sql selection required the date to be
formatted in a certain way.

The function below is what I use (in the UK).

? sqldate(date())                // returns 03.04.2021


Bruce


FUNCTION SQLDate
* Converts a date or date object to a date format suitable for an sql
filter.
* Replaces / with .   Does not alter the sequence DMY.
parameter dt
local indate
private ty
ty = type("dt")
if ty $ "OD"
    indate = dtoc(dt)
elseif ty = "C"
    indate = (dt)
else
    msgbox("[L198]  Not a date or object or string.   ", "SQLDate", 48)
    return false
endif
do while at("/", indate) > 0
    indate = stuff(indate, at("/", indate), 1, ".")
enddo
return (indate)                   // a string.