Subject: | Re: code change
| Date: | Mon, 19 Apr 2021 15:51:15 +0200
| From: | modridirkac <jure.zorko@gmail.com>
| Newsgroups: | pnews.paradox-programming
|
proc firstOfYear(d date) date
return( date( 1,1,year(d)) )
endProc
proc lastOfYear(d date) date
return( date( 12,31,year(d)) )
endProc
proc wholeYear(d date, var fD date, var lD date)
fD = firstOfYear(d)
lD = lastOfYear(d)
endProc
On Sat, 17 Apr 2021 10:35:27 +0200, Tony spencer
<tracy.fairbrother@btopenworld.com> wrote:
>
>
> Thanks for you help with this if I wanted a years worth of data
> what parts would i need to change. Ie 01/01/2020 until 31/12/2020
>
> modridirkac <jure.zorko@gmail.com> wrote:
>> proc firstOfMonth(d date) date
>> return( date(month(d),1,year(d)) )
>> endProc
>>
>>
>> proc lastOfMonth(d date) date
>> return( date(month(d),daysInMonth(d),year(d)) )
>> endProc
>>
>> proc wholeMonth(d date, var fD date, var lD date)
>> fD = firstOfMonth(d)
>> lD = lastOfMonth(d)
>> endProc
>>
>> proc getTable()
>> var q query
>> TC TCursor
>> dStr string
>> fD, lD date
>> endVar
>> wholeMonth( today8) , fd, ld)
>> dStr = ">="+string(fd) + " ,<="+string(ld)
>> q = query
>>
>> :work:mytable.db | Date |
>> Check | ~dStr |
>>
>> endQuery
>> q.executeQbe(TC)
>> scan TC :
>> ; do something
>> endScan
>> endProc
>>
>>
>> On Fri, 02 Apr 2021 11:26:40 +0200, Tony spencer
>> <Tracy.fairbrother@btopenworld.com> wrote:
>>
>>>
>>> proc StartDate(d date) date
>>> ; proc returns start date for given date
>>> ; if date is before 16th, start date is begining of month
>>> if day(d) < 16 then
>>> return( date(month(d),1,year(d)) )
>>> else
>>> return( date(month(d),16,year(d)) )
>>> endIf
>>> endProc
>>>
>>> proc EndDate(d date) date
>>> ; proc returns end date for given date
>>> ; if date is before 16th, end date is 15,
>>> ; if date if 16th or later, end date is end of month
>>> if day(d) < 16 then
>>> return( date(month(d),15,year(d)) )
>>> else
>>> return( date(month(d),daysInMonth(d),year(d)) )
>>> endIf
>>> endProc
>>>
>>>
>>>
>>> Help how would I change this if I wanted a months worth of data any
>>> help
>>> would be appreciated
>>
>>
>> --
>> Using Opera's mail client: http://www.opera.com/mail/
>
--
Using Opera's mail client: http://www.opera.com/mail/
|