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!

Urgent Parameter dispaly current date noon to yesterday noon

Status
Not open for further replies.

syedmca

Technical User
Jul 28, 2007
16
IN
Hi,

I need to create 2 parameter
1) start date
@) end date

The above two parameter must display default date in start date as yesterday noon to enddate current date noon & if uer selects any date then it must display that date noon to one day before noon .

Kindly help me in this regard,

Start Date: 2008/04/15 12:00:00(noon)
End date: 2008/04/14 12:00:00(nooon)


I need to dispaly it in report header

Start date nooon to endate noon

Thanks,
Syed
 
Instead of Parameters use a formula

@Start Date

DateTime(Year(currentDate), Month(currentdate), Day(currentdate), 12, 0, 0)

@End Date
{@Start Date} -1

Ian
 
Hi,

According to specification they need prompt in there report with functionality like default with current date (start date) & current date-1 (end date) and also user must be able to select any date with start noon and enddate noon
 
I'm assuming this is for record selection. I think you should use only one date prompt, since you are always looking for the same range. First set up a default value like 1/1/1800. Then set up a selection formula like this:

if {?start} <> date(1800,1,1) then
{table.datetime} in datetime({?start}-1,time(12,0,0)) to
datetime({?start},time(11,59,59)) else
if {?start} = date(1800,1,1) then
{table.datetime} in datetime(currentdate-1,time(12,0,0)) to
datetime(currentdate,time(11,59,59))

For the text display in the report header, use:

if {?start} <> date(1800,1,1) then
(
totext(datetime({?start}-1,time(12,0,0)),"MM/dd/yyyy hh:mm") + " to " +
totext(datetime({?start},time(11,59,59)),"MM/dd/yyyy hh:mm")
) else
(
totext(datetime(currentdate-1,time(12,0,0)),"MM/dd/yyyy hh:mm") +" to " +
totext(datetime(currentdate,time(11,59,59)),"MM/dd/yyyy hh:mm")
)

-LB
 
Hi,

In requirement they need prompt for this report to take what user gives as well report must dispaly defult value as current date.
 
Hi ,

In this requirement 2 prompt(StartDate & Enddate) need to be created as for record selection I am going to use
Column start_timestamp for start prompt and Column End_tiemstamp for end prompt .
So, Above formulae may not work because same { table.datetime } we are going to use in both start & end date
Kindly help me in this regard

Thanks
Syed
 
Are you saying you are checking two different fields against the prompts? If so, what are the criteria? How does each field relate to each prompt?

-LB
 
Hi,

Thanks for your quick response,
I am check for start prompt against column start_timestamp
And End prompt against End_ time stamp

I need to display default value for start prompt as currentdate-1 noon
End date prompt default as Current date noon.Other wise user can select their date.

 
That doesn't really answer my question, but I'll just make some assumptions. The following assumes you are setting up the start and end parameters as date parameters:

if {?start} <> date(1800,1,1) then
{table.start_timestamp} >= datetime({?start}-1,time(12,0,0)) and
{table.end_timestamp} < datetime({?end},time(12,0,0)) else
if {?start} = date(1800,1,1) then
{table.start_timestamp} >= datetime(currentdate-1,time(12,0,0)) and
{table.end_timestamp} < datetime(currentdate,time(12,0,0))

For the text display in the report header, use:

if {?start} <> date(1800,1,1) then
(
totext(datetime({?start}-1,time(12,0,0)),"MM/dd/yyyy hh:mm") + " to " +
totext(datetime({?end},time(11,59,59)),"MM/dd/yyyy hh:mm")
) else
(
totext(datetime(currentdate-1,time(12,0,0)),"MM/dd/yyyy hh:mm") +" to " +
totext(datetime(currentdate,time(11,59,59)),"MM/dd/yyyy hh:mm")
)

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top