Paradox Community

Items in pnews.paradox-programming

Subject:Re: code change
Date:Tue, 06 Apr 2021 14:01:03 +0200
From:modridirkac <jure.zorko@gmail.com>
Newsgroups:pnews.paradox-programming
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/


Copyright © 2004 thedbcommunity.com