Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Demanding and difficult logic qns PART 2. Sorry but i need help.


Demanding and difficult logic qns PART 2. Sorry but i need help.

Author
Message
10e5x
10e5x
SSC-Enthusiastic
SSC-Enthusiastic (109 reputation)SSC-Enthusiastic (109 reputation)SSC-Enthusiastic (109 reputation)SSC-Enthusiastic (109 reputation)SSC-Enthusiastic (109 reputation)SSC-Enthusiastic (109 reputation)SSC-Enthusiastic (109 reputation)SSC-Enthusiastic (109 reputation)

Group: General Forum Members
Points: 109 Visits: 180
Hi Lynn, i finally got it!!! what a smart use of * -1 to ensure consecutive dates and same dates fall to the same group date. THANKS:-D
10e5x
10e5x
SSC-Enthusiastic
SSC-Enthusiastic (109 reputation)SSC-Enthusiastic (109 reputation)SSC-Enthusiastic (109 reputation)SSC-Enthusiastic (109 reputation)SSC-Enthusiastic (109 reputation)SSC-Enthusiastic (109 reputation)SSC-Enthusiastic (109 reputation)SSC-Enthusiastic (109 reputation)

Group: General Forum Members
Points: 109 Visits: 180
Hi lynn,

Not sure if u will see this. I deployed my system using your solution to the UAT. Everything works great. The solution was efficient. However after some round of testing, the user decided to add in new business requirement.

Lets say with the same sample data, just that on top of entry datetime, each record now has a additional of exit datetime. I already derived a new column DURATION by getting the datediff from these two fileds.

The user want to check if it is possible to add in another criteria in order for the records to be considered as a consecutive day. Meaning if the duration is more than 6 hours, and with no gap, then it will be consider consecutive. SO now it no longer only depends on the entry_dt itself

I am trying to draft out a table for better understanding.
Any help?

Thanks in advance
Lynn Pettis
Lynn Pettis
SSC-Insane
SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)

Group: General Forum Members
Points: 24157 Visits: 37925
10e5x (1/24/2013)
Hi lynn,

Not sure if u will see this. I deployed my system using your solution to the UAT. Everything works great. The solution was efficient. However after some round of testing, the user decided to add in new business requirement.

Lets say with the same sample data, just that on top of entry datetime, each record now has a additional of exit datetime. I already derived a new column DURATION by getting the datediff from these two fileds.

The user want to check if it is possible to add in another criteria in order for the records to be considered as a consecutive day. Meaning if the duration is more than 6 hours, and with no gap, then it will be consider consecutive. SO now it no longer only depends on the entry_dt itself

I am trying to draft out a table for better understanding.
Any help?

Thanks in advance


First, requirements always change. Second, based on what you have posted, nope, can't help. Third, we are volunteers on ssc. We don't get paid to help, we do it for free as a way to give back to the community.

The code you deployed is yours now and your responsibility to support. You are the one that needs to support it and modify it when needed. You need help with modifying it? You need to show me that you have made a good faith effort to make the appropriate changes and explain where you having problems implementing the change(s) required. This means posting DDL, sample data, expected results, what you have done so far to meet the new requirements, explaining what is and isn't working.

Cool
Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search