<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
	xmlns:media="http://search.yahoo.com/mrss/"
	>
<channel>
	<title>Comments on: Using a &#8220;Magic Date&#8221; Value in Prompts</title>
	<atom:link href="http://www.dagira.com/2008/07/21/using-a-magic-date-value-in-prompts/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dagira.com/2008/07/21/using-a-magic-date-value-in-prompts/</link>
	<description>...you are in a twisty maze of passageways, all different...</description>
	<lastBuildDate>Thu, 09 Sep 2010 09:57:30 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Dave Rathbun</title>
		<link>http://www.dagira.com/2008/07/21/using-a-magic-date-value-in-prompts/comment-page-1/#comment-1227</link>
		<dc:creator>Dave Rathbun</dc:creator>
		<pubDate>Thu, 17 Jun 2010 02:52:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.dagira.com/?p=98#comment-1227</guid>
		<description>Ben, you are welcome. Glad to have helped. The char() function has tripped me up more than once. :)</description>
		<content:encoded><![CDATA[<p>Ben, you are welcome. Glad to have helped. The char() function has tripped me up more than once. <img src='http://www.dagira.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben</title>
		<link>http://www.dagira.com/2008/07/21/using-a-magic-date-value-in-prompts/comment-page-1/#comment-1225</link>
		<dc:creator>Ben</dc:creator>
		<pubDate>Wed, 16 Jun 2010 17:19:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.dagira.com/?p=98#comment-1225</guid>
		<description>Dave,  Thanks for all your guidance on this.  What I got to finally work was...

Cast((convert(varchar(2),(dbo.step2_Rptd_Inv.RPTD_MTH))) +’-‘ + (convert(varchar(2),(dbo.step2_Rptd_Inv.RPTD_DT))) +’-‘ + (convert(varchar(4),(dbo.step2_Rptd_Inv.RPTD_YR))) + ‘ 00:00:00’ as smalldatetime)

Thanks again for your help.

Ben</description>
		<content:encoded><![CDATA[<p>Dave,  Thanks for all your guidance on this.  What I got to finally work was&#8230;</p>
<p>Cast((convert(varchar(2),(dbo.step2_Rptd_Inv.RPTD_MTH))) +’-‘ + (convert(varchar(2),(dbo.step2_Rptd_Inv.RPTD_DT))) +’-‘ + (convert(varchar(4),(dbo.step2_Rptd_Inv.RPTD_YR))) + ‘ 00:00:00’ as smalldatetime)</p>
<p>Thanks again for your help.</p>
<p>Ben</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Rathbun</title>
		<link>http://www.dagira.com/2008/07/21/using-a-magic-date-value-in-prompts/comment-page-1/#comment-1224</link>
		<dc:creator>Dave Rathbun</dc:creator>
		<pubDate>Wed, 16 Jun 2010 12:52:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.dagira.com/?p=98#comment-1224</guid>
		<description>Ben, the char() command returns the ASCII symbol (letter, number, special character) that matches the input value. For example, character 32 in the ASCII table is the space. So char(32) returns &#039; &#039;. The reason you&#039;re getting a &quot;box&quot; is because your characters are outside of the printable range.

You probably want to look at the cast() function. I would first convert the number values to string, then concatenate them with appropriate delimiters, then cast that result as date or datetime as needed.</description>
		<content:encoded><![CDATA[<p>Ben, the char() command returns the ASCII symbol (letter, number, special character) that matches the input value. For example, character 32 in the ASCII table is the space. So char(32) returns &#8216; &#8216;. The reason you&#8217;re getting a &#8220;box&#8221; is because your characters are outside of the printable range.</p>
<p>You probably want to look at the cast() function. I would first convert the number values to string, then concatenate them with appropriate delimiters, then cast that result as date or datetime as needed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben</title>
		<link>http://www.dagira.com/2008/07/21/using-a-magic-date-value-in-prompts/comment-page-1/#comment-1221</link>
		<dc:creator>Ben</dc:creator>
		<pubDate>Tue, 15 Jun 2010 17:23:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.dagira.com/?p=98#comment-1221</guid>
		<description>Hi there, you&#039;ve got a great site and has been very helpful.  I&#039;ve got an issue that I&#039;ve come across and can&#039;t seem to get a clear answer.  The database is MS SQL Server 2005.  The database guys are giving me 3 fields for date (coming in as numeric values).  I&#039;m trying to combine them into a date format in 1 dimension.  I get year 2010, month = 6 and day = 12 in 3 fields.  I&#039;ve tried bringing them in with &quot;char()&quot; function in three separate objects, but all I get is a square.  It seems that the fields coming in as numbers won&#039;t convert to character, and don&#039;t know exactly what to do to get this to work.  When I use convert, it is adding all of them together.  Attempts I&#039;ve tried..

convert(char((time\convertedmonth) + (time\convertedday) + (time\convertedyr)),101)

I&#039;ve also tried using char in each...

select convertedyr char(table.yr) (this one gives me an output of the unrecognizable symbol of a square.

Any suggestions?

Sincerely,

Ben</description>
		<content:encoded><![CDATA[<p>Hi there, you&#8217;ve got a great site and has been very helpful.  I&#8217;ve got an issue that I&#8217;ve come across and can&#8217;t seem to get a clear answer.  The database is MS SQL Server 2005.  The database guys are giving me 3 fields for date (coming in as numeric values).  I&#8217;m trying to combine them into a date format in 1 dimension.  I get year 2010, month = 6 and day = 12 in 3 fields.  I&#8217;ve tried bringing them in with &#8220;char()&#8221; function in three separate objects, but all I get is a square.  It seems that the fields coming in as numbers won&#8217;t convert to character, and don&#8217;t know exactly what to do to get this to work.  When I use convert, it is adding all of them together.  Attempts I&#8217;ve tried..</p>
<p>convert(char((time\convertedmonth) + (time\convertedday) + (time\convertedyr)),101)</p>
<p>I&#8217;ve also tried using char in each&#8230;</p>
<p>select convertedyr char(table.yr) (this one gives me an output of the unrecognizable symbol of a square.</p>
<p>Any suggestions?</p>
<p>Sincerely,</p>
<p>Ben</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Rathbun</title>
		<link>http://www.dagira.com/2008/07/21/using-a-magic-date-value-in-prompts/comment-page-1/#comment-1207</link>
		<dc:creator>Dave Rathbun</dc:creator>
		<pubDate>Wed, 02 Jun 2010 06:26:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.dagira.com/?p=98#comment-1207</guid>
		<description>Hi, Chaitanya. It sounds like in your requirement you are trying to provide a different default value based on a user profile. As discussed in this post, we don&#039;t have any sort of scripting capability in prompts at this time. It would probably be best to leave the prompt blank (no default) and create a List of Values (LOV) query that invokes the security profile to provide a list of choices appropriate to the user. Mark it to &quot;Refresh on use&quot; so it gets invoked every time.</description>
		<content:encoded><![CDATA[<p>Hi, Chaitanya. It sounds like in your requirement you are trying to provide a different default value based on a user profile. As discussed in this post, we don&#8217;t have any sort of scripting capability in prompts at this time. It would probably be best to leave the prompt blank (no default) and create a List of Values (LOV) query that invokes the security profile to provide a list of choices appropriate to the user. Mark it to &#8220;Refresh on use&#8221; so it gets invoked every time.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chaitanya</title>
		<link>http://www.dagira.com/2008/07/21/using-a-magic-date-value-in-prompts/comment-page-1/#comment-1202</link>
		<dc:creator>Chaitanya</dc:creator>
		<pubDate>Tue, 01 Jun 2010 12:59:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.dagira.com/?p=98#comment-1202</guid>
		<description>Hi Dave..

This is a interesting Blog...i hope some of ur expertise might help me with a business requirement. We have got a cascading prompt for Territory/Region and Division and these are assigned to diferent level of users. So, when the prompt displays in the Webi Report the value that displays in the prompt should be defaulted to whatever value is assigned to the user (let it be Terr/Division/Region).

The user security is all handled at the DB(Oracle). Can you help me how to default the values in the prompt for this scenario?</description>
		<content:encoded><![CDATA[<p>Hi Dave..</p>
<p>This is a interesting Blog&#8230;i hope some of ur expertise might help me with a business requirement. We have got a cascading prompt for Territory/Region and Division and these are assigned to diferent level of users. So, when the prompt displays in the Webi Report the value that displays in the prompt should be defaulted to whatever value is assigned to the user (let it be Terr/Division/Region).</p>
<p>The user security is all handled at the DB(Oracle). Can you help me how to default the values in the prompt for this scenario?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Rathbun</title>
		<link>http://www.dagira.com/2008/07/21/using-a-magic-date-value-in-prompts/comment-page-1/#comment-1120</link>
		<dc:creator>Dave Rathbun</dc:creator>
		<pubDate>Sat, 01 May 2010 03:24:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.dagira.com/?p=98#comment-1120</guid>
		<description>No, the default date will not be &quot;yesterday&quot; with this technique. The way the condition gets interpreted the 1/1/1900 is converted to yesterday (or whatever date is derived from your logic) but it doesn&#039;t change the entered prompt value. The code as provided returns &quot;Today&quot; and not &quot;Yesterday&quot; anyway. The Teradata constant DATE returns the current system date.

Make sure you are comparing to a date column and not a datetime column. You might try this:

&lt;code&gt;cast(DATE_CNTL.DT2_PRCS as date) = CASE WHEN @Prompt(’Please Select Business Date:’,&#039;D’,,mono,free) =’1900-01-01&#039; THEN DATE ELSE @Prompt(’Please Select Business Date:’,&#039;D’,,mono,free) END&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>No, the default date will not be &#8220;yesterday&#8221; with this technique. The way the condition gets interpreted the 1/1/1900 is converted to yesterday (or whatever date is derived from your logic) but it doesn&#8217;t change the entered prompt value. The code as provided returns &#8220;Today&#8221; and not &#8220;Yesterday&#8221; anyway. The Teradata constant DATE returns the current system date.</p>
<p>Make sure you are comparing to a date column and not a datetime column. You might try this:</p>
<p><code>cast(DATE_CNTL.DT2_PRCS as date) = CASE WHEN @Prompt(’Please Select Business Date:’,'D’,,mono,free) =’1900-01-01' THEN DATE ELSE @Prompt(’Please Select Business Date:’,'D’,,mono,free) END</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lilly</title>
		<link>http://www.dagira.com/2008/07/21/using-a-magic-date-value-in-prompts/comment-page-1/#comment-1119</link>
		<dc:creator>Lilly</dc:creator>
		<pubDate>Fri, 30 Apr 2010 20:34:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.dagira.com/?p=98#comment-1119</guid>
		<description>Hi, Dave:

We use Teradata.  I created the prompt using your code.  When I entered 1/1/1900, yesterday&#039;s data was not returned.  Is it true that I can expect to see the default value will be Today&#039;s Date after I save the report and run it again?

Thank you very much.

Lilly</description>
		<content:encoded><![CDATA[<p>Hi, Dave:</p>
<p>We use Teradata.  I created the prompt using your code.  When I entered 1/1/1900, yesterday&#8217;s data was not returned.  Is it true that I can expect to see the default value will be Today&#8217;s Date after I save the report and run it again?</p>
<p>Thank you very much.</p>
<p>Lilly</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sanjoy</title>
		<link>http://www.dagira.com/2008/07/21/using-a-magic-date-value-in-prompts/comment-page-1/#comment-1117</link>
		<dc:creator>Sanjoy</dc:creator>
		<pubDate>Fri, 30 Apr 2010 12:23:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.dagira.com/?p=98#comment-1117</guid>
		<description>Hi Dave,

I am new to this blog,Is this code also valid for SAP BW Database?</description>
		<content:encoded><![CDATA[<p>Hi Dave,</p>
<p>I am new to this blog,Is this code also valid for SAP BW Database?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Rathbun</title>
		<link>http://www.dagira.com/2008/07/21/using-a-magic-date-value-in-prompts/comment-page-1/#comment-1115</link>
		<dc:creator>Dave Rathbun</dc:creator>
		<pubDate>Tue, 27 Apr 2010 13:56:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.dagira.com/?p=98#comment-1115</guid>
		<description>Hi, Lilly, thanks for your question. The first item to consider: are you using Teradata? The functions and date formats could be different on different databases. Second, the prompt as defined does not offer a list of values, but users should still be able to select from the calendar widget.</description>
		<content:encoded><![CDATA[<p>Hi, Lilly, thanks for your question. The first item to consider: are you using Teradata? The functions and date formats could be different on different databases. Second, the prompt as defined does not offer a list of values, but users should still be able to select from the calendar widget.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
