<?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/"
		>
<channel>
	<title>Comments on: SQR Dates</title>
	<atom:link href="http://peoplesoftsqr.com/index.php/2009/04/sqr-dates/feed/" rel="self" type="application/rss+xml" />
	<link>http://peoplesoftsqr.com/index.php/2009/04/sqr-dates/</link>
	<description>When Peoplebooks Is Not Enough</description>
	<lastBuildDate>Mon, 12 Jul 2010 20:20:25 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: administrator</title>
		<link>http://peoplesoftsqr.com/index.php/2009/04/sqr-dates/comment-page-1/#comment-1776</link>
		<dc:creator>administrator</dc:creator>
		<pubDate>Fri, 07 Aug 2009 21:14:02 +0000</pubDate>
		<guid isPermaLink="false">http://peoplesoftsqr.com/?p=300#comment-1776</guid>
		<description>Welcome to the blog, Kevin.  Questions are always welcome.

If you are storing the date in a variable, like this:

let $now = datenow()

you need be declare the variable as a date variable, like this:

begin-setup
declare-variable
date $now
end-declare
end-setup

If you don&#039;t declare $now as a date variable, SQR will make it a string variable.  When you set $now equal to datenow(), SQR will convert the date to a string that looks like a date in your default format.  Then, when you set a database date field to that value, SQR will convert the string to datetime that is 0 seconds after midnight.

You may find it easier to use the built-in database variable for system date and time.  In Oracle, it is SYSDATE.  You could write something like this:

begin-sql
update tablename
set datefield = sysdate
where keyfield = &#039;X&#039;
end-sql</description>
		<content:encoded><![CDATA[<p>Welcome to the blog, Kevin.  Questions are always welcome.</p>
<p>If you are storing the date in a variable, like this:</p>
<p>let $now = datenow()</p>
<p>you need be declare the variable as a date variable, like this:</p>
<p>begin-setup<br />
declare-variable<br />
date $now<br />
end-declare<br />
end-setup</p>
<p>If you don&#8217;t declare $now as a date variable, SQR will make it a string variable.  When you set $now equal to datenow(), SQR will convert the date to a string that looks like a date in your default format.  Then, when you set a database date field to that value, SQR will convert the string to datetime that is 0 seconds after midnight.</p>
<p>You may find it easier to use the built-in database variable for system date and time.  In Oracle, it is SYSDATE.  You could write something like this:</p>
<p>begin-sql<br />
update tablename<br />
set datefield = sysdate<br />
where keyfield = &#8216;X&#8217;<br />
end-sql</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kevin</title>
		<link>http://peoplesoftsqr.com/index.php/2009/04/sqr-dates/comment-page-1/#comment-1772</link>
		<dc:creator>Kevin</dc:creator>
		<pubDate>Fri, 07 Aug 2009 17:01:24 +0000</pubDate>
		<guid isPermaLink="false">http://peoplesoftsqr.com/?p=300#comment-1772</guid>
		<description>Hi,

I have a question about the use of the DATENOW()function in PeopleSoft SQR.  In my pursuit of answers I came across this blog.  I&#039;m not sure asking this question is appropriate, but here goes.

I need to get the current datetime and update a field in a table.  When I use the DATENOW() function I am getting the current date with time of 12:00:00 AM.  Any ideas about what is occurring here

Thanks,
Kevin</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I have a question about the use of the DATENOW()function in PeopleSoft SQR.  In my pursuit of answers I came across this blog.  I&#8217;m not sure asking this question is appropriate, but here goes.</p>
<p>I need to get the current datetime and update a field in a table.  When I use the DATENOW() function I am getting the current date with time of 12:00:00 AM.  Any ideas about what is occurring here</p>
<p>Thanks,<br />
Kevin</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: administrator</title>
		<link>http://peoplesoftsqr.com/index.php/2009/04/sqr-dates/comment-page-1/#comment-423</link>
		<dc:creator>administrator</dc:creator>
		<pubDate>Thu, 21 May 2009 16:24:49 +0000</pubDate>
		<guid isPermaLink="false">http://peoplesoftsqr.com/?p=300#comment-423</guid>
		<description>Welcome to my blog, Robert.

The datediff function only works with date variables.  You have to declare them in the setup section like this:

begin-setup
declare-variable
date $eff_dte $pay_end_dt
end-declare
end-setup

Then you need to set their values properly.  If you are getting values from a database table, this is sufficient:

let $eff_dte = &amp;EFFDT
let $pay_end_dt = &amp;PAY_END_DT

But if you get them from any other source, you have to do something like this:

let $eff_dte = strtodate(&#039;05/21/2009&#039;, &#039;mm/dd/yyyy&#039;)
let $pay_end_dt = strtodate(&#039;30-APR-2009&#039;, &#039;dd-mon-yyyy&#039;)

This seems like a lot of work, but I think it&#039;s worth it.  Then your datediff will work and you can write:

if #date_diff &lt; 6

I assume your &quot;if &#039;datediff&#039; &lt; 6&quot; was a typo.  You were comparing a string and a number.</description>
		<content:encoded><![CDATA[<p>Welcome to my blog, Robert.</p>
<p>The datediff function only works with date variables.  You have to declare them in the setup section like this:</p>
<p>begin-setup<br />
declare-variable<br />
date $eff_dte $pay_end_dt<br />
end-declare<br />
end-setup</p>
<p>Then you need to set their values properly.  If you are getting values from a database table, this is sufficient:</p>
<p>let $eff_dte = &amp;EFFDT<br />
let $pay_end_dt = &amp;PAY_END_DT</p>
<p>But if you get them from any other source, you have to do something like this:</p>
<p>let $eff_dte = strtodate(&#8217;05/21/2009&#8242;, &#8216;mm/dd/yyyy&#8217;)<br />
let $pay_end_dt = strtodate(&#8217;30-APR-2009&#8242;, &#8216;dd-mon-yyyy&#8217;)</p>
<p>This seems like a lot of work, but I think it&#8217;s worth it.  Then your datediff will work and you can write:</p>
<p>if #date_diff &lt; 6</p>
<p>I assume your &#8220;if &#8216;datediff&#8217; &lt; 6&#8243; was a typo.  You were comparing a string and a number.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ROBERT O</title>
		<link>http://peoplesoftsqr.com/index.php/2009/04/sqr-dates/comment-page-1/#comment-422</link>
		<dc:creator>ROBERT O</dc:creator>
		<pubDate>Thu, 21 May 2009 14:32:58 +0000</pubDate>
		<guid isPermaLink="false">http://peoplesoftsqr.com/?p=300#comment-422</guid>
		<description>I am looking for help with:

Let #Date_diff = datediff ($Eff_Dte, $Pay_End_Dt, $MONTH) 
    If &#039;datediff&#039; &lt; 6

I am looking to compare employee start date vs. current pay period end date, to check whether a specific earn type was used within 6 months of their start date.

These are the errors I am getting:

Error on line 620:
   (SQR 4045) Function or operator &#039;datediff&#039; requires date argument.

Error on line 620:
   (SQR 4045) Function or operator &#039;datediff&#039; requires date argument.

Error on line 621:
   (SQR 4048) Function or operator &#039;&lt;&#039; must be a string or date argument.

Thanks, Robert.</description>
		<content:encoded><![CDATA[<p>I am looking for help with:</p>
<p>Let #Date_diff = datediff ($Eff_Dte, $Pay_End_Dt, $MONTH)<br />
    If &#8216;datediff&#8217; &lt; 6</p>
<p>I am looking to compare employee start date vs. current pay period end date, to check whether a specific earn type was used within 6 months of their start date.</p>
<p>These are the errors I am getting:</p>
<p>Error on line 620:<br />
   (SQR 4045) Function or operator &#8216;datediff&#8217; requires date argument.</p>
<p>Error on line 620:<br />
   (SQR 4045) Function or operator &#8216;datediff&#8217; requires date argument.</p>
<p>Error on line 621:<br />
   (SQR 4048) Function or operator &#8216;&lt;&#8217; must be a string or date argument.</p>
<p>Thanks, Robert.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Edward deShelly</title>
		<link>http://peoplesoftsqr.com/index.php/2009/04/sqr-dates/comment-page-1/#comment-287</link>
		<dc:creator>Edward deShelly</dc:creator>
		<pubDate>Wed, 22 Apr 2009 01:48:54 +0000</pubDate>
		<guid isPermaLink="false">http://peoplesoftsqr.com/?p=300#comment-287</guid>
		<description>Well, I agree with Bob. You should do a blog entry about calculating non-Gregorian dates.

So now you have two people asking for it. How much more demand do you need?</description>
		<content:encoded><![CDATA[<p>Well, I agree with Bob. You should do a blog entry about calculating non-Gregorian dates.</p>
<p>So now you have two people asking for it. How much more demand do you need?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: administrator</title>
		<link>http://peoplesoftsqr.com/index.php/2009/04/sqr-dates/comment-page-1/#comment-279</link>
		<dc:creator>administrator</dc:creator>
		<pubDate>Mon, 20 Apr 2009 21:37:03 +0000</pubDate>
		<guid isPermaLink="false">http://peoplesoftsqr.com/?p=300#comment-279</guid>
		<description>We&#039;ll see if the demand materializes.</description>
		<content:encoded><![CDATA[<p>We&#8217;ll see if the demand materializes.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bob Josephson</title>
		<link>http://peoplesoftsqr.com/index.php/2009/04/sqr-dates/comment-page-1/#comment-278</link>
		<dc:creator>Bob Josephson</dc:creator>
		<pubDate>Mon, 20 Apr 2009 20:04:53 +0000</pubDate>
		<guid isPermaLink="false">http://peoplesoftsqr.com/?p=300#comment-278</guid>
		<description>Well, there&#039;s an opportunity for a blog post: how to calculate those dates.</description>
		<content:encoded><![CDATA[<p>Well, there&#8217;s an opportunity for a blog post: how to calculate those dates.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: administrator</title>
		<link>http://peoplesoftsqr.com/index.php/2009/04/sqr-dates/comment-page-1/#comment-276</link>
		<dc:creator>administrator</dc:creator>
		<pubDate>Mon, 20 Apr 2009 17:10:44 +0000</pubDate>
		<guid isPermaLink="false">http://peoplesoftsqr.com/?p=300#comment-276</guid>
		<description>I hope this is just one of many accomplishments of which you may boast.</description>
		<content:encoded><![CDATA[<p>I hope this is just one of many accomplishments of which you may boast.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: administrator</title>
		<link>http://peoplesoftsqr.com/index.php/2009/04/sqr-dates/comment-page-1/#comment-275</link>
		<dc:creator>administrator</dc:creator>
		<pubDate>Mon, 20 Apr 2009 17:09:40 +0000</pubDate>
		<guid isPermaLink="false">http://peoplesoftsqr.com/?p=300#comment-275</guid>
		<description>SQR has a few functions for the Japanese calendar, but I haven&#039;t seen anything else.  Of course, I&#039;m viewing the documentation supplied in English for the American market, so there may be a whole world I&#039;ve never seen.</description>
		<content:encoded><![CDATA[<p>SQR has a few functions for the Japanese calendar, but I haven&#8217;t seen anything else.  Of course, I&#8217;m viewing the documentation supplied in English for the American market, so there may be a whole world I&#8217;ve never seen.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bob Josephson</title>
		<link>http://peoplesoftsqr.com/index.php/2009/04/sqr-dates/comment-page-1/#comment-272</link>
		<dc:creator>Bob Josephson</dc:creator>
		<pubDate>Mon, 20 Apr 2009 12:23:24 +0000</pubDate>
		<guid isPermaLink="false">http://peoplesoftsqr.com/?p=300#comment-272</guid>
		<description>Some places have a need to know dates such as Good Friday, Rosh Hashanna, or Chinese New Year (e.g. religious organizations that give those days as paid holidays, or secular companies that allow floating holidays to be taken only on real holidays). Does SQR have anything to help identify dates on non-Gregorian calendars?</description>
		<content:encoded><![CDATA[<p>Some places have a need to know dates such as Good Friday, Rosh Hashanna, or Chinese New Year (e.g. religious organizations that give those days as paid holidays, or secular companies that allow floating holidays to be taken only on real holidays). Does SQR have anything to help identify dates on non-Gregorian calendars?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
