|
Posted by Erland Sommarskog on 09/23/06 19:49
Beowulf (beowulf_is_not_here@hotmail.com) writes:
> Thanks for taking the time to reply. I always appreciate your advice
> here. I'm a little confused by your suggestion. What I have is a
> duration (start datetime and end datetime). Would an "hour" to "part of
> day" table still work with this data or would I have to convert the
> start and end date into something else first?
I don't know. That is, I don't know what your business requirements are,
so I cannot answer. I made the simple assumption that only the start time
applied. If you want to split a call that started at 17:23 and ended at
18:14 into day and evening, I don't know in which way you want to split it.
<Standard rant>
Please post:
o CREATE TABLE(s) statements for your tables.
o INSERT statements with sample data.
o The desired result given the sample.
That makes it possible to easily copy and paste to develop a tested
solution.
</Standard rant>
(It's not likely that it will be me this time though, as I'm
off for vacation tomorrow.)
> Do you have any pointers to good tutorials on calendar tables (or is
> google my friend)? It's a concept I haven't heard of before.
http://www.aspfaq.com, search for calendar. Aaron has several entries
on them.
Essentially a calendar is a table with one row for each day, and then
you associate attributes to the days that are appropriate for your
business like IsWorkingDay.
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Navigation:
[Reply to this message]
|