Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Novice > Calculating rep...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 5 Topic 3154 of 3255
Post > Topic >>

Calculating repeating events - functionality lost with the demise

by psql-novice@[EMAIL PROTECTED] (Netzach) Jul 2, 2008 at 01:21 PM

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-8-I"
 http-equiv="Content-Type">
  <title></title>
</head>
<body alink="#ee0000" bgcolor="#ffffff" link="#0000ee" text="#33ff33"
 vlink="#551a8b">
<font color="#000000"><tt>Hi list,<br>
<br>
I need to know whether a repeating event occurs or not on a particular
day. I currently have the following information:<br>
<br>
date of first occurrence (date)<br>
repeat frequency (interval)<br>
date to check (date)<br>
<br>
My instinct says that I should be using a mod here to calculate whether
the remainder is zero when the difference between the two times is
divided by the repeat frequency. Unfortunately this is not possible
since as far as I am aware intervals only specify a time length and not
two dates. When searching I discovered tinterval which appears to do
what I would want, and was surprised to discover that it is not
sup****ted in my postgres install because it is too _new_ !?! (PG 8.1).<br>
<br>
I then considered trying to extract the units from the repeat_frequency
interval and then calculating the difference between date_to_check and
first_occurrence in those units (eg weeks, months). But I was unable to
find a reasonable way to find out the units of an interval.<br>
<br>
I could try an approximation using </tt><tt class="LITERAL"><code
 class="FUNCTION">justify_interval() and friends and then use a short
loop to get an accurate result. This is also a hack.</code></tt><br>
<tt><br>
This has to be a very standard requirement. How does one go about
calculating whether a difference between two dates is a multiple of a
particular interval in an elegant fa****on ?<br>
<br>
<br>
Thanks,<br>
<br>
Netzach<br>
</tt></font>
<br>
</body>
</html>
 




 5 Posts in Topic:
Calculating repeating events - functionality lost with the demis
psql-novice@[EMAIL PROTEC  2008-07-02 13:21:01 
Re: Calculating repeating events - functionality lost with the d
tgl@[EMAIL PROTECTED] (T  2008-07-02 10:57:55 
Re: Calculating repeating events - functionality lost with
psql-novice@[EMAIL PROTEC  2008-07-02 18:37:28 
Re: Calculating repeating events - functionality lost with the d
tgl@[EMAIL PROTECTED] (T  2008-07-02 13:01:59 
Re: Calculating repeating events - functionality lost with
psql-novice@[EMAIL PROTEC  2008-07-03 12:29:56 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Oct 11 6:03:51 CDT 2008.