cancel
Showing results for 
Search instead for 
Did you mean: 

Getting 22007 error while trying to prompt with today's date in webi using @prompt at universe .?

Former Member
0 Kudos

Hi All,

I am trying to get the default date as todays date in the webi report. for that I have done as below in the universe, but encountering error

Select Clause: Project.CreatedDate

Where clause: Project.CreatedDate = (CASE WHEN @Prompt('Enter date or Today','A',,mono,free,not_persistent,{'Today'})='Today' THEN 'sd' ELSE @Prompt('Enter date or Today','A',,mono,free,not_persistent,{'Today'}) END)

The CreatedDate format is in DateTime, the above one is not getting parsed showing as error.

The values for the CreatedDate is in below image.

Please help me in getting todays date as default in report.

Thanks,

Santhosh

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

What is 'sd'? Looks like you're trying to compare a datetime data type with a varchar data type.

Also, I'd avoid building this object with the where clause. Instead, put the where clause in a predefined condition otherwise you will ALWAYS be prompted for this condition whether you want to or not when you use the Project Created Date object.

Former Member
0 Kudos

I am really sorry , Actually there must be GETDATE() but i have tested that the formula is not parsing due to getdate or not, so I removed getdate and kept some junk string there, apologies for that.

Thanks for correcting me.

Please help me on the situation. I simply want to get todays date as default date in the webi report and later, If the user refreshes the report he must be able to select previous dates in the report. but by default he must get today's data.

Thanks,

Santhosh.

Former Member
0 Kudos

In that case, have a read of this blog post:

http://www.dagira.com/2008/07/21/using-a-magic-date-value-in-prompts/

It explains everything far better than I could in the time I've got to post on here.

Regards,

Mark