cancel
Showing results for 
Search instead for 
Did you mean: 

Prompt with Default date (Sysdate/Current Date )

Former Member
0 Kudos

Hi All,

Requirement-

I have to show by default Sysdate/Currentdate against u201CEndDateu201D prompt into report.

I am working on XIR3.1 i require prompt with default date Sysdate or today.i have been searched on forum ..i found there is magic date solution .like that

Time.End_date = case when @prompt('Enter End date','D',,mono,free) = '1900-01-01' then sysdate else @prompt('Enter End date','D',,mono,free) end

But this work around will not going to map our requirement.Because user will more confuse with this '1900-01-01' constant.

we have to show today against End date...is there any other solution or work around to accomplish this requirment.if it is not how can we solved by SDK

Thanks,

Kumar

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

I already built universes with the requirements you are asking.

Here is a sample on SQL Server.

First create a derived table like this:

select * from 
(select 'Current date' as invoice_date_char, convert(datetime,convert(varchar,getdate(),111),111) as  invoice_date
union
select distinct convert(varchar,invoice_date,111), invoice_date
from Club.dbo.Sales)   a

Then you have to create an object that references the "invoice_date" column. In my sample, I modified the Where clause of the object to force users to select a date with the Currentdate as default value. Here is the Where clause:

Dates.invoice_date_char in @Prompt('Select date','A','Dates\Invoice Date Char',multi,constrained,,{'Current date'})

Regards

Didier