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!

Select Formula

Status
Not open for further replies.

malk

MIS
Dec 12, 2000
84
US
Can Someone help me with this:

I have six numeric parameters and three numeric data fields:
parameters:
year1
year2
month1
month2
day1
day2

database:
year to num
month to num
day to num

I am trying to write a select formula to select records between the 2 user defined dates.
Starting date: month1/day1/year1
Ending Date: month2/day2/year2

i tried this, but it gave me no results:

{@year to num} in {?year1} to {?year2} and
if ({@year to num} = {?year1}) then {@month to num} >= {?month1} and
if ({@year to num} = {?year2}) then {@month to num} <= {?month2} and
if ({@year to num} = {?year1} and {@month to num} = {?month1}) then {@day to num} >= {?day1}and
if ({@year to num} = {?year2} and {@month to num} = {?month2}) then {@day to num} <= {?day2}and

Can somebody PLEASE HELP me???????????


 
You could convert all three to dates:

Date ( {@year to num}, {@month to num}, {@day to num} )
in
Date ({?Year1}, {?Month1}, {?Day1})
to
Date ({?Year2}, {?Month2}, {?Day2})

To speed up performance you might also add the first part of your rule, because the conversion happens on the client:

and {@year to num} in {?year1} to {?year2}
Ken Hamady
Crystal Reports Training and a
Quick Reference Guide to VB/Crystal
 
Thanx alot. That worked perfectly!!!!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top