Page 1 of 1

Logic for implementation of the req

Posted: Tue Oct 04, 2011 12:27 pm
by InfoSeek
Gurus, here is something that I need your help on

I have two cols - F.No and W.No (Both of Datatype Integer), and two date cols , s.date and e.date


||F.No||W.NO||e.date||s.date||

F.no - is supposed to have only one W.no associated with it, and only either of s.date or e.date associated with it.

Currently its so happening that some W.no's have both e.date and s,.date , and if that is happening we need to push the s.date ahead (something like a s.date + 5, not quite that simple , but for the purposes of this conv something like that).....

This so, that every w.no has only date associated with it.

I'm really stumped for the logic and don't where to begin.

Any pointers in the right direction are greatly appreciated

Thank you for your time

Regards
IS

Posted: Tue Oct 04, 2011 3:22 pm
by us1aslam1us
It is quite hard to understand your requirement. Share some information on how your input data looks and what exactly are you expecting in your output.

Sample Data??

sAM

Some more data

Posted: Tue Oct 04, 2011 3:49 pm
by InfoSeek
Sorry, here is more info.

The First column is activity number , the second col is week number , the date cols are end.date and start.date....

This is how ideally the data should look like
F.no||w.No||e.date||s.date||
1 || 234||Oct 4th||0||


The current data looks like
F.no||w.No||e.date||s.date||
1 || 234||Oct 4th||Oct 6th||

One activity cannot have either a e.date or s.date for the same week (w.No), not both as is the case in the above example.

If that's the case the activity s.date needs to be pushed to the next week (235).

So the data should look like
F.no||w.No||e.date||s.date||
1 || 234||Oct 4th||0||
1||235||0||Oct 6th||


At this point even the date representation doesnt matter, what is really necessary if a week has both e.date and s.date , the s.date gets pushed to the next week (from 234 to 235).

Thank you for taking the time to look at it and respond.

Regards
IS

Posted: Tue Oct 04, 2011 4:40 pm
by ray.wurlod
Derive EDate as something like:

Code: Select all

If IsNotNull(InLink.SDate) And IsNotNull(InLink.EDate) Then DateFromDaysSince(7,InLink.EDate) Else InLink.EDate
Apply appropriate conversion functions where needed.

Posted: Tue Oct 04, 2011 10:57 pm
by InfoSeek
Thank you Ray for the input, will try this.

We've modified the query at source currently but will try this as well.