Who's Online
0 registered (), 1 Guest and 6 Spiders online.
Key: Admin, Global Mod, Mod
Recent Posts
Abseces in oracle hrms, super user: how to do I:
by tovia123
Today at 01:18 PM
Update EIT in SSHR
by Sahir
Yesterday at 03:45 PM
End of Year Legislation Patch for 11i
by delboy
Yesterday at 01:35 PM
Interfacing iRec and external sites
by DanC
09/02/12 11:42 PM
Capturing, Storing, & Paying Banked Overtime
by Paul
09/02/12 08:51 PM
Time and Labour & Oracle Projects
by Paul
09/02/12 07:34 PM
Search Engine Optimizers
by delboy
09/02/12 01:30 PM
Function for getting retropay-maintained balances
by CT
08/02/12 12:21 PM
Grade End Date
by Chris
03/02/12 10:46 AM
OLM Mandatory Enrolments
by bcooper
01/02/12 12:23 PM
Top Posters (30 Days)
CT 26
delboy 24
bcooper 14
Sahir 5
Gus 5
tovia123 5
Tim Bailey 3
SBi 3
christm 3
Simon_Mc 3
(Views)Popular Topics
Family Pack K issues thread 18240
CREATE_GRADE api returns:PLS-00306: wrong number o 13772
Still trying to locate... 12214
Creating hr jobs ORA-20001: HR_289477_JOB_GROUP_ID 10658
Viewing Output of another user 9137
HR_PF.K RUP4 8851
Review of my Release 12 laptop 8500
Adding a taskflow button to a form 7861
Enhanced Retro & Release 12 7689
Family Pack K 7127
Topic Options
Rate This Topic
#1124 - 23/03/05 02:12 PM Janet & John do Date-track Queries
CT Offline
Guru
***

Registered: 11/03/05
Posts: 1080
Loc: Bath
From the J&J archives of 07/04/2003:

Morning all

Here's a little anecdote primarily (but not exclusively) aimed at our non-HR/Payroll friends who may be called upon at some stage to go ferreting around for information on HR/Payroll/Benefits DateTracked tables. Apologies to anyone who thinks I'm stating the bl**din' obvious but if it helps only one person to avoid the problem then I would deem it a worthwhile excercise

Last week whilst on site at a large council in the Cheshire area doing some payroll-related work I was accosted by a rather excitable council employee who took great pains to explain to me that Oracle HR has a very serious bug in it. (A bug? In Oracle HR? Shome mishtake shurely!!!)

Apparently as well as HR and Payroll they also have Oracle Purchasing and Oracle Projects. This gentleman being of the 'Projects' persuasion was being informed by Projects that certain submitted timecards were not valid as the system could find no supervisor to approve them. He had done the usual TAR-raising activity whereupon it was found that the rejected timecards were all for employees whose supervisors had a change to their assignment record effective the day after the timecard submission date. The reason is quite simple but may reveal something of a misconception on the part of the Oracle Projects Development Team where DateTrack is concerned.

Basically the bit of code trying to get the supervisor included this:

Select <stuff>
FROM per_all_assignments_f
WHERE assignment_id = <whatever>
AND sysdate BETWEEN effective_start_date
AND effective_end_date
AND ...

All very easy. But wait!! It's not finding a row where there's a change starting tomorrow. Why not?

Well the thing about DateTrack is that there is never a time element involved (otherwise it would be called 'TimeTrack' and quite frankly that concept frightens me). It follows that the smallest unit of date effective change is 1 day. If you think of a date-effective change taking place from tomorrow in terms of just a date then in the table it might look like this:

ID Effective Start Date Effective End Date
123 01-JAN-2003 07-APR-2003
123 08-APR-2003 31-DEC-4712

The basic rule of date effective changes is being obeyed in that we have a contiguous span of time ie no missing days.

If however you look at the dates in terms of a date and time then it would look like this:
ID Effective Start Date Effective End Date
123 01-JAN-2003 00:00:00 07-APR-2003 00:00:00
123 08-APR-2003 00:00:00 31-DEC-4712 00:00:00

On the face of it things aren't any different. But look at the effective end date/time of the old record and compare it with the effective start date/time of the new record. There is in fact a 'gap' here of 24 hours! Because the code was using 'sysdate' to get the current assignment row it was in effect treating date track dates as date/time values and for these poor unfortunates was indeed 'falling down the gap'.

Moral of the story: Be like the elephant - use your trunc()!! (Cue loud groans shaking of heads leaping from nearest window etc)

OK how about: Using trunc(sysdate) in the above query would cure the problem instantly

Hope this helps somebody

Cheers

Janet & John

Top
#1125 - 28/07/05 07:38 AM Re: Janet & John do Date-track Queries
jhatten Offline
hacker

Registered: 15/03/05
Posts: 95
Loc: London
CT . .You can now consider this a worthwhile exercise - I have blatantly plagiarised this post to explain to our OTL Dev friends in the states the concept of DateTrack… they are still thinking about it. . .Jay

Top
#1126 - 08/08/05 09:53 PM Re: Janet & John do Date-track Queries
CT Offline
Guru
***

Registered: 11/03/05
Posts: 1080
Loc: Bath
Ah let the royalty cheques commence.... KER CHIIIIINGG
_________________________
L&K
CT

Remember: A dog is for life, not just for Christmas... unless you're in Korea

Top
#1127 - 10/08/05 03:57 PM Re: Janet & John do Date-track Queries
bcooper Offline

Guru
*****

Registered: 11/03/05
Posts: 1095
Loc: Earth, Europe, England, here
<cough>sponsorship</cough>
_________________________
HCM Aces is for sale! Please contact me if you are interested.
Also my random musings courtesy of Twitter

Top
#1128 - 11/08/05 08:27 AM Re: Janet & John do Date-track Queries
CT Offline
Guru
***

Registered: 11/03/05
Posts: 1080
Loc: Bath
How far are you walking and which charity is it for?
_________________________
L&K
CT

Remember: A dog is for life, not just for Christmas... unless you're in Korea

Top
#1129 - 22/08/06 12:10 PM Re: Janet & John do Date-track Queries [Re: CT]
jemson Offline
regular

Registered: 16/04/05
Posts: 25
Loc: New York City
Ahh Clive

You have no idea how much I miss you correcting my pathetic attempts at SQL!!! Can I bribe you with imports of US goods??!!!
_________________________
Joules

Top
#1130 - 23/08/06 04:29 PM Re: Janet & John do Date-track Queries [Re: jemson]
CT Offline
Guru
***

Registered: 11/03/05
Posts: 1080
Loc: Bath
Hello Joules, how the devil are you? I can't believe they haven't cottoned-on to you and removed all traces of SQL access from your PC...
_________________________
L&K
CT

Remember: A dog is for life, not just for Christmas... unless you're in Korea

Top



Moderator:  CT 
Forum Stats
756 Members
48 Forums
1517 Topics
7287 Posts

Max Online: 63 @ 24/11/10 07:21 AM
Today's Birthdays
No Birthdays
Recent vacancies
Tea boy available 4 basic chores & some! services
by Simon_Mc
19/01/12 03:59 PM
Top Posters
bcooper 1095
CT 1080
delboy 500
Geoff Dixon 369
SBi 344
vkumar 223
kp_rapolu 213
cbrookes 197
Gavin Harris 160
Gus 132
February
Su M Tu W Th F Sa
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29