ca.portal.admin

Re:Re: Broken Chain

Discussion created by ca.portal.admin on Jan 14, 2008
Hi Colette,

There is no owner pointer in the CALC set.

Laura Rochon
Ajilon Consulting

Simpson, Colette [DOT] wrote:
I am trying to fix a broken chain which is in the CALC set of a
record.
The next and prior db keys seem to be fine, but the owner pointer
seems to point to the wrong owner. I can see the next and prior
pointers in the record, but cannot find the owner pointer. Can
someone tell me where to look for the CALC chain owner pointer for a
record, so I can fix it to point to the correct owner?

TIA
Colette

"
IDMS Public Discussion Forum
IDMS-L@LISTSERV.IUASSN.COM
SMTP
IDMS-L@LISTSERV.IUASSN.COM
IDMS-L@LISTSERV.IUASSN.COM
SMTP








Normal

Normal
Re: SQL Data Arithmetic
"I asked one of our SQL programmers and they this in response:

The code below should get the correct results and run efficiently. I
am taking into account that the columns may have a time value associated
with the date. This should be tested - it is ""use at your own risk.""

15th of prior month (use >= operator as expression is 15th of previous
month at 00:00:000)
cast(cast(year(dateadd(M,-1,dateadd(d,15 +
day(current_timestamp)*-1,current_timestamp))) * 10000
+ month(dateadd(M,-1,dateadd(d,15 +
day(current_timestamp)*-1,current_timestamp))) * 100
+ day(dateadd(M,-1,dateadd(d,15 +
day(current_timestamp)*-1,current_timestamp)))as char) as datetime)

end of prior month (use < operator as expression is 1st day of current
month at 00:00:000)
cast(cast(year(dateadd(d,1 +
day(current_timestamp)*-1,current_timestamp)) * 10000
+ month(dateadd(d,1 +
day(current_timestamp)*-1,current_timestamp)) * 100
+ day(dateadd(d,1 +
day(current_timestamp)*-1,current_timestamp))as char) as datetime)

1st of this month (use >= as expression is 1st day of current month at
00:00:000)
cast(cast(year(dateadd(d,1 +
day(current_timestamp)*-1,current_timestamp)) * 10000
+ month(dateadd(d,1 +
day(current_timestamp)*-1,current_timestamp)) * 100
+ day(dateadd(d,1 +
day(current_timestamp)*-1,current_timestamp))as char) as datetime)

14th of current month (use < as expression is 15th of month at
00:00:000)
cast(cast(year(dateadd(d,15 +
day(current_timestamp)*-1,current_timestamp)) * 10000
+ month(dateadd(d,15 +
day(current_timestamp)*-1,current_timestamp)) * 100
+ day(dateadd(d,15 +
day(current_timestamp)*-1,current_timestamp)) as char) as datetime)

So Select 1 would be: WHERE BILLDATE_ENT_DATE >=
cast(cast(year(dateadd(M,-1,dateadd(d,15 +
day(current_timestamp)*-1,current_timestamp))) * 10000
+ month(dateadd(M,-1,dateadd(d,15 +
day(current_timestamp)*-1,current_timestamp))) * 100
+ day(dateadd(M,-1,dateadd(d,15 +
day(current_timestamp)*-1,current_timestamp)))as char) as datetime) and
BILLDATE_ENT_DATE < cast(cast(year(dateadd(d,1 +
day(current_timestamp)*-1,current_timestamp)) * 10000
+ month(dateadd(d,1 +
day(current_timestamp)*-1,current_timestamp)) * 100
+ day(dateadd(d,1 +
day(current_timestamp)*-1,current_timestamp))as char) as datetime)
chris@MIAMIDADE.GOV 01/11/2008 2:36:34 PM >>>
One of our programmers needs help coding SQL SELECTs involving date
arithmetic.



The first SELECT runs the first week of the month and must return data
for the fifteenth through the last day of the prior month.



The second SELECT runs the third week of the month and must return
data
for the first through the fourteenth day of the current month.



The pertinent part of the WHERE clause currently has hardcoded dates
which are modified before each execution -



WHERE BILLDATE_ENT_DATE BETWEEN 20071201 AND 20071214



Any suggestions on how to code the WHERE clauses for the first and
second SELECTs so as to avoid hardcoded dates would be greatly
appreciated.
"
IDMS Public Discussion Forum
IDMS-L@LISTSERV.IUASSN.COM
SMTP
IDMS-L@LISTSERV.IUASSN.COM
IDMS-L@LISTSERV.IUASSN.COM
SMTP








Normal

Normal
Re: Broken Chain
"Thanks to everyone who sent responses to my problem. I don't have to
use the list too often, but when I do I always know everyone will be so
kind, helpful and knowledgeable. I changed the pointers in the record
to point back to itself and changed other pointers in the other records
to leave that record out and then DBOL allowed me to erase the problem
record. I think I have identified the batch program which caused my
problem.

Thanks, again!

Colette

Outcomes