For Programmers: Free Programming Magazines  


Home > Archive > Clipper > January 2005 > Range problem...still









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Range problem...still
happy

2005-01-28, 8:55 am

I have made 2 fields of of ranges reporting :
one for month_numeric(2),the other for the year_numeric(4) .


My report printing correctly from the inner year The range
Month from : 1 year : 2004
Month to : 9 year : 2004



How can I handle monthes between 2 years


Month from : 9 year : 2002
Month to : 6 year : 2004

I need the a condition that contain month and year and accumulate both
of them ..

Condition :
*------------

if (alltrim(str(2->month))==alltrim(str(MOnth_from+w1))) ;
..and. (alltrim(str(2->year))==alltrim(str(year_from))) .and. (w1<n)


Down is my code :
w:=0
n:=(MOnth_to)-(MOnth_from)+1

do while 3->(!eof())
if (3->mc_start_d)==date_test
? 3->mc_serial
?? space (1)
for i = 1 to n
select 2
go top
do while 2->(!eof())

if (alltrim(str(2->month))==alltrim(str(MOnth_from+w1))) ;
..and. (alltrim(str(2->year))==alltrim(str(year_from))) .and. (w1<n)

?? 2-> charge
skip +1
w1++
loop
else
select 2
skip +1
loop
endif
enddo
next
w1:=0

select 3
skip +1
loop
else
select 3
skip +1
loop
endif

enddo


My line result :
1 Printer 1193653 M0020760 DP75 / / Baghdad
Baghdad_Operator _Operator-Paper 22477 22107
27404 23689 27536 27400 27412 26997 37091
18373 14525 17455 292466

cal

2005-01-28, 8:55 am

On 28 Jan 2005 01:11:02 -0800, "happy" <ehab_aziz2001@yahoo.com>
wrote:

>I have made 2 fields of of ranges reporting :
>one for month_numeric(2),the other for the year_numeric(4) .
>
>
>My report printing correctly from the inner year The range
>Month from : 1 year : 2004
>Month to : 9 year : 2004
>
>
>
>How can I handle monthes between 2 years
>
>
>Month from : 9 year : 2002
>Month to : 6 year : 2004
>
>I need the a condition that contain month and year and accumulate both
>of them ..
>
>Condition :
>*------------
>
>if (alltrim(str(2->month))==alltrim(str(MOnth_from+w1))) ;
>.and. (alltrim(str(2->year))==alltrim(str(year_from))) .and. (w1<n)
>
>


If you're not too far along with this project, might it not be better
to use a date field to designate the chronological order of your item?

Then you could test each item for inclusion in a specified range using
the functions intrinsic to Clipper.

Just for your consideration.
Cal



happy

2005-01-28, 3:55 pm

can any body give me an idea about what WhatEverDate could be to
convert numeric variables into date variables ,Also I will compare
those date variables after converting with date fields also after
converting them.
Thanks

Ian Boys

2005-01-28, 3:55 pm

Something like:

* nMonth = Month of Year
* nYear = Yest
* LFirst = First date=True Last Day=False
*
Function GetDate(nMonth,nYear,LFirst)
If LFirst
dDate := CtoD('01/'+alltrim(str(nMonth,2))+'/'+str(nYear,4))
else
dDate := CtoD('01/'+alltrim(str(nMonth+1,2))+'/'+str(nYear,4))-1
Endif

Ian Boys
DTE

"happy" <ehab_aziz2001@yahoo.com> wrote in message
news:1106931974.397926.167200@f14g2000cwb.googlegroups.com...
> can any body give me an idea about what WhatEverDate could be to
> convert numeric variables into date variables ,Also I will compare
> those date variables after converting with date fields also after
> converting them.
> Thanks
>



happy

2005-01-28, 8:55 pm

I added a date filed and I renter all dates . OK
If my condition is as below , I got wrong results,

if
(alltrim(3->mc_serial)==alltrim(2->me_serial)) .and. ;
((2->me_date)>=(V_da_from)) .and.
((2->me_date)<=(V_da_to))

AUGE_OHR

2005-01-28, 8:55 pm

hi,

> I have made 2 fields of of ranges reporting :
> one for month_numeric(2),the other for the year_numeric(4) .
>
FOR MONTH = 2

you have ask this some mounth ago and i have tell you that your way is
wrong. While you have Index with Year/Month there is not need to "setFilter"
or "Range" in this way, use SCOPE
[color=darkred]
> How can I handle monthes between 2 years
> Month from : 9 year : 2002
> Month to : 6 year : 2004


example : Me_cu_acct = "1234567890"

SET SCOPETOP TO "1234567890200209"
SET SCOPEBOTTOM TO "1234567890200406"

greetings by OHR
Jimmy


Stephen Quinn

2005-01-29, 3:55 am

Jimmy

[color=darkred]
> SET SCOPETOP TO "1234567890200209"
> SET SCOPEBOTTOM TO "1234567890200406"


Won't work while +ME_SERIAL+ is in the index expression and the FOR condition
will exclude every month but February from the index anyway.

I don't believe he can achieve what he wants with the INDEX expressions & FOR
clauses he's using for the browsing, he needs to build entirely new indices for
his report IMO.

--
HTH
Steve


AUGE_OHR

2005-01-29, 3:55 am

hi

METER1[color=darkred]
[color=darkred]
> Won't work while +ME_SERIAL+ is in the index expression and the FOR

condition
> will exclude every month but February from the index anyway.


you are right, this was a "slave" index.
the master index only include :
INDEX ON STR(Me_cu_acct,10)+ME_SERIAL+STR(YEAR,4)
;
TO METERUNI UNIQUE

>
> I don't believe he can achieve what he wants with the INDEX expressions &

FOR
> clauses he's using for the browsing, he needs to build entirely new

indices for
> his report IMO.


if he enhance "MasterIndex" with mounth and Set Scope on "MasterIndex"
than he shoud be able "to print from browser" without a seperate report
modul.

greetings by OHR
Jimmy


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com