# $Id: slips_by_choice.rep,v 1.1 1999/12/27 22:14:27 shevett Exp $
#
##
# Slips By Choice 	 		slips_by_choice.rep (p)1999
#
# Keystone(tm) report
#
# Name:	    slips_by_choice.rep # (p)1999
# Author:   Frans Stekelenburg, Acriter IFS
# email:    gjs@acriter.com
# www:      www.acriter.com
#
# description: This is a exercise in more extensive use of the report
#	functionality of Keystone(tm) (www.stonekeep.com), as it uses
#	optional input fields for the user to fill in to narrow down
#	the result of the query.
#	This report can be used as a base for various other reports
#	since in it are 'hidden' (commented) other optional selection,
#	query and column fields.
#	Actually they also have not been used because they may conflict
#	with the rest of the selections. 
#
#	Remarks: 
#	- The VAR section, used for the user configurable input
#	  options can only go from VAR1 to VAR9
#	- The COL section can go beyond 9- limit is 99?
#	  (or whatever is still readable:-))
#
#	- 'dtype = date' (mm/dd/yy) can be used both in	VAR and COL defs.
#	  'dtype = datetime' (mm/dd/yy hh:mm) only in COL definitions.
#	  'dtype = time' (hh:mm) ditto, only in COL defs.
#

TITLE: Slips by Choice
VERSION: 1.3
REQUIRES: 0.60.01
DATASET: slips

VAR1:
{
        text = Enter a start date
        dtype = date
        default = 915145915
}
VAR2:
{
        text = Enter an end date
        dtype = date
        default = today
}

VAR3:
{
        text = Last Tech
        dtype = varchar(10)
}

VAR4:
{
        text = Current Tech
        dtype = varchar(10)
}


VAR5:
{
        text = Ignore status(es)
        default = C
}

VAR6:
{
        text = Parent ID
}

VAR7:
{
	text = Ignore Priority/ies
}

VAR8:
{
        text = <b>Last Activity</b><br>&nbsp;&nbsp;&nbsp;Between:
        dtype = date
        default = 915145915
}
VAR9:
{
        text = &nbsp;&nbsp;&nbsp;and:
        dtype = date
        default = today
}

##################### Reserves###########

#VAR6:
#{
#        text = <b>Scheduled Open date</b><br>&nbsp;&nbsp;&nbsp;Between:
#        dtype = date
#        default = 915145915
#}
#VAR7:
#{
#        text = &nbsp;&nbsp;&nbsp;and:
#        dtype = date
#        default = today
#}

#VAR8:
#{
#        text = <b>Scheduled Close date</b><br>&nbsp;&nbsp;&nbsp;Between:
#        dtype = date
#        default = 915145915
#}

#VAR9:
#{
#        text = &nbsp;&nbsp;&nbsp;and:
#        dtype = date
#        default = today
#}

#VAR12:
#{
#	text = <b>Priority</b><br>&nbsp;&nbsp;&nbsp;From:
#	default = 1
#}
#VAR13:
#{
#	text = <b>Priority</b><br>&nbsp;&nbsp;&nbsp;To:
#	default = 8
#}

#VAR14:
#{
#        text = Parent ID
#}

#VAR15:
#{
#        text = Depending on...
#}

#VAR16:
#{
#        text = Group
#}

#VAR17:
#{
#        text = Contact ID
#}


#VAR18:
#{
#	text = Public 
#        dtype = int(1)
#	default = 1
#}

#VAR19:
#{
#	text = Keyword
#}
	
SQL:
{
	select slips.sid, status.flag, slips.currtech, slips.problem, status.label, is_public,
		slips.priority, slips.o_date, slips.sc_date, slips.spid, slips.depend,
		slips.grp, slips.ctag, slips.l_activity
		from slips, status
		where slips.status = status.flag
	        and slips.o_date BETWEEN VAR1 AND VAR2
                and slips.l_tech LIKE '%VAR3%'
	        and slips.currtech LIKE '%VAR4%'
                and NOT INSTR('VAR5', slips.status)
		and slips.spid LIKE '%VAR6%'
		and NOT INSTR('VAR7', slips.priority)
		group by slips.sid, status.flag, slips.currtech, is_public
}
  
# These seletions didn't make it into the base version:
#
	#and slips.l_activity BETWEEN VAR10 AND VAR11
	#and slips.priority BETWEEN VAR12 AND VAR13 
	#and slips.spid LIKE '%VAR14%'
	#and slips.depend LIKE '%VAR15%'
	#and slips.grp LIKE '%VAR16%'
	#and slips.ctag LIKE '%VAR17%'
	#and is_public LIKE '%VAR10%'
	#
	#and slips.so_date BETWEEN VAR6 AND VAR7
	#and slips.sc_date BETWEEN VAR8 AND VAR9

COL1:
{
	label = Slip
	display = sid
}
COL2:
{
	label = Status
	display = label
}
COL3:
{
	label = Tech
	display = currtech
}
COL4:
{
	label = Problem Description
	display = problem
}
COL5:
{
	label = Opened<br><font size=-2>mm/dd/yy</font>
	display = o_date
	dtype = date
}
COL6:
{
	label = P<br>r<br>i
	display =  priority
}
COL7:
{
	label = ContactID
	display =  ctag
}
COL8:
{
	label = Last Act.
	display = l_activity
	dtype = datetime
}
COL9:
{
	label = Sched. Close
	display = sc_date
	dtype = date
}
COL10:
{
	label = S
	display = flag	
}
COL11:
{
	label = P<br>u<br>b
	display = is_public	
}
COL12:
{
	label = G<br>r<br>p
	display = grp
}
COL13:
{
	label = <font size=-2>Spid</font>
	display =  spid

}

# Is there a limit...?
#
