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

Set default End Of Range for date parameter 1

Status
Not open for further replies.

ianoctdec

Programmer
Feb 6, 2003
190
CA
Hi,
CE 10, DHTML viewer
When select values for a datetime parameter, the default is something like 2005,15,08,0,0,0.
Is it posible to set the default end of range for datetime parameter to 2005,15,08,23,59,59? Our users expects that the default end of range will go to the end of the day!

Thank you,
Daniela
 
Not without rewriting part of the parameter collection screen.

How I handle this is to prepopulate the datetime with an impossible value, su8ch as 1/1/1970, and use the prompting text and training to explain that if they don't change the ending datetime range, it will default to todays date.

Then in the record selection formula use something like:

(
if cdate(maximum({?MyDateRangeParm})) <> cdate(1970,1,1) then
{table.datetyime} in {?MyDateRangeParm}
else
if cdate(maximum({?MyDateRangeParm})) = cdate(1970,1,1) then
{table.datetime} >= minimum({?MyDateRangeParm})
and
{table.datetime} <= maximum({?MyDateRangeParm})
)

-k
 
Thank you SV.
I was thinking of this kind of solution too.
I use in the records selection:
if time(maximum({?CreateDate})) = time(0,0,0) then
{BE_Production.invtrans_create_date} >= minimum({?CreateDate})
and
{BE_Production.invtrans_create_date} < DateAdd("d", 1, maximum({?CreateDate}))
else
{BE_Production.invtrans_create_date} = {?CreateDate}

This way I will select records until the end of the day that is the end of selected range.

Daniela
 
Note that I intentionally devise the code to pass SQL to the database, check the Database->Show SQL to make sure yours is doing so or performance will suffer.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top