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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parameter Default dates and user Dates issue

Status
Not open for further replies.

JSMITH242B

Programmer
Joined
Mar 7, 2003
Messages
352
Location
GB
Hi All,
I have 2 parameters DateStart and DateEnd.
I have set defaults for these: DateStart 01/04/2005 and DateEnd 31/12/2009.
However the user has the option to enter in their own dates.
I have used the following formulae but it is not returning the correct records.
Any ideas?
({Purchase_Requests.Open Date & Time} IN {?DateStart} TO {?DateEnd} OR ({?DateStart} >= date('01/04/2005') and {?DateEnd} <= DATE('31/12/2099')))

Your help is much appreciated.
 
Try something like:

(
if {?DateStart} <> date(2005,04,01) then
{table.date} >= {?DateStart} else
{table.date} >= date(2005,04,01)
) and
(
if {?DateEnd} <> date(2099,12,31) then
{table.date} <= {?DateEnd} else
{table.date} <= date(2099,12,31)
)

-LB

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top