Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do i select a record using formula

Status
Not open for further replies.

mamba74fr

Technical User
Oct 31, 2004
12
GA
Hi all ,

I have my table like that i can print from sequel console.

Org.OrgID Org.Org Name Org.Course Org.Time
1145 MATH_DPT MATH 03/13/05
1146 PHYS_DPT PHYS 03/26/05
1147 BIOL_DPT BIOL 03/13/05
1148 ECON_DPT ECON 03/18/05
1149 MATH_DPT MATH 03/23/05
1144 FREN_DPT FRENCH 03/13/05


i would like to print to build a formula that allows me to select the record :
" 1149" when i give that 2 parameters : MATH and 03/23/05

i want to write something like

select O.OrgID from Org O where O.Course like 'MATH' and O.Time like '03/23/05'

or but much more something like

if {Org.Course}='MATH' and {Org.Time}='03/23/05' then {Org.OrgID}
else "" ;


Thank you a lot
 
Click on report, edit selection formula, record, then enter a boolean formula:

{Org.Course}='MATH' and {Org.Date}=date(2005,3,23)

Let me know if you have any questions.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports
 
Hi

Thank you for your help but i have one other question.

the fact is i wanted to create a function that let me print the result whatever the input parameter i provide on the same report and i can just paste the formula by changing the input data.

Doing like that
{Org.Course}='MATH' and {Org.Date}=date(2005,3,23)
i won't be able to have for example on the same reportthe result of :

{Org.Course}='BIOL' and {Org.Date}=date(2005,3,13)
which is 1147


i would like to print the results of my criteria everywhere on my page header section like that :

Class1 Class2 Class3
Org.OrgID MATH_DPT
Org.Org Name
Org.Course MATH



Thank you ,

Any help !
 
Create parameter fields for course and date, and substitute the parameter fields for the hard coded valued you have in the formula now.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports
 
Hi ,

Thank you again for your help !

In other way how come i could write that function extract in CR10, where {?d_date} is a field parameter valid on the data of my report :

Function Extract(stringvar topic,stringvar res,datevar day,)
begin
if {Org.Course}=topic and {Org.Date}=day then return(res)
else return("") ;
end


And execute the function with that logic :
Extract('MATH',{?d_date}, {Org.OrgID})

Thank you,

Any help !

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top