Paradox Community

Items in pnews.paradox-programming

Subject:Re: code change
Date:2 Apr 2021 14:46:38 -0400
From:"Kevin Zawicki" <numberjack@wi.rr.com>
Newsgroups:pnews.paradox-programming


>months worth of data

What exactly does this mean? 
Last 30 days?
one actual month?

if you pass 4/2/2021 do you want

4/1/2021 and 4/30/2021 back?

if using in a query you could pass a date and get a string back (examples)

>=4/1/2019,<=4/30/2019  - use in query

or 04/../2021 give all of April 2021.

you would take your dates and cast as a string into a query

maybe we need more info


"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 


Copyright © 2004 thedbcommunity.com