Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Print summary in report
Message
From
08/10/2003 09:53:10
 
 
To
08/10/2003 09:43:12
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00836084
Message ID:
00836192
Views:
8
>ok i'm sorry for not making myself clear. problem for me is i don't know at design time how many fields will appear in my report. like this cursor depends on the type of leaves of all employees. there are like 20 type of leaves, and i'm trying to get rid of those leaves that were not used for the month.
>
>say, only VL and SL were availed by all employees, only VL and SL should appear in my cursor.
>
>i'll take a look at the solutions you gave me, thanks! =)


Evelyn,

Ok, you mean : how many different values for Leave

Think both the solutions 1 && 2 deal with that. Look at the select after the 'union all'.

To be on the safe side you could write
select	tt_emp		as	emp_, ;
		year(tt_date)	as	year_, ;
		month(tt_date)	as	month_, ;
		0		as	grp, ;
		day(tt_date)	as	day_, ;
		tt_leave	as	leave_, ;
		$1		as	count_ ;
	    from test ;
	    into cursor ReportCursor2 ;
	union all ;
	select	tt_emp		as	emp_, ;
		year(tt_date)	as	year_, ;
		month(tt_date)	as	month_, ;
		1		as	grp, ;
		0		as	day_, ;
		tt_leave	as	leave_, ;
		ntom(count(*))	as	count_ ;
	    from test ;
	    group by 1,2,3,4,5,6 ;
            having !empty(count_) ;                    && ADDED
        order by 1,2,3,4,5 && ,6
Gregory
Previous
Reply
Map
View

Click here to load this message in the networking platform