August 4, 2010 at 11:45 am
Stefan Krzywicki (8/4/2010)
mtillman-921105 (8/4/2010)
ALZDBA (8/4/2010)
GilaMonster (8/4/2010)
Jack Corbett (8/4/2010)
Probably the most complex SQL I've had to write. Too many OUTER JOINs (business requires this design), and then parameters that could turn the OUTER JOINs to INNER JOINs and may not be what the business wants in some cases.Swap?
I got stuck this afternoon helping out with a query where I needed to add several columns that stored elapsed time.
Easy enough? Sure, except that the person who designed the database stored those elapsed times as the TIME datatype.
And you can't add two time columns. Makes sense, there's no meaning to 11am + 5pm. However in this case 11am meant 11 hours and 5pm meant 17 hours. Cue multiple conversions to datetime followed by DATEPART(mi,...) followed by DATEADD followed by a cast back to TIME.
and how do they store +24 hours in that time column ? (add an extra daycounter column ??) ๐
When can we convert to Metric Time?
Metric time really isn't all that farfetched! You'd have 10 hours in a day, 100 minutes in an hour and 100 seconds in a minute. The only adjustment that needs to to be made is to make the second a little longer than the second is now.
Now that would suck!!!! There would only be 2 hours left in the days after putting in an 8 hour work day. WAIT!! Add the 1 hour for lunch and you only have 1 hour left! WAIT!!! Add 35 minute commute to get to work and ..... I just ran out of time!!!! :w00t:
Excuse me boss, can I leave a few minutes early so I can get back to work on time? ๐
For best practices on asking questions, please read the following article: Forum Etiquette: How to post data/code on a forum to get the best help[/url]
August 4, 2010 at 11:53 am
Alvin Ramard (8/4/2010)
Excuse me boss, can I leave a few minutes early so I can get back to work on time? ๐
ROTFLMAO
Stop spying on my workplace!
August 4, 2010 at 11:53 am
ALZDBA (8/4/2010)
and how do they store +24 hours in that time column ? (add an extra daycounter column ??) ๐
Can't happen. There's a row per day and the hours in all the columns cannot add up to more than 24
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
August 4, 2010 at 11:55 am
Stefan Krzywicki (8/4/2010)
Metric time really isn't all that farfetched! You'd have 10 hours in a day, 100 minutes in an hour and 100 seconds in a minute. The only adjustment that needs to to be made is to make the second a little longer than the second is now.
That's the easy bit. But it doesn't really work until the reaction to the tidal effects of the earth's mass on the sun slows the earth's rotation enough so that we have a 100 day year. That won't be for a long time yet, so I don't expect to see decimal time in my lifetime, even if I do manage to get dbcc timewarp to restore the database containing the description of a simple procedure for gaining effective immortality onto my laptop.
Of course I see metric time already - we've had clocks, eggtimers, and sandglasses for a long time now, and I'm not one to allow a bunch of foreigners to usurp a perfectly good word like "metric" and claim it means something that it doesn't.
Tom
August 4, 2010 at 11:56 am
Oh, switching topics.
We had the best Mongolian BBQ place in town a few years back. Now it's gone. I miss it so much. I need to track down a new one.
Has anyone here ever had Mongolian BBQ?
I've been to one in Kansas City several times. Love it!
The Redneck DBA
August 4, 2010 at 12:00 pm
Alvin Ramard (8/4/2010)
Stefan Krzywicki (8/4/2010)
mtillman-921105 (8/4/2010)
ALZDBA (8/4/2010)
GilaMonster (8/4/2010)
Jack Corbett (8/4/2010)
Probably the most complex SQL I've had to write. Too many OUTER JOINs (business requires this design), and then parameters that could turn the OUTER JOINs to INNER JOINs and may not be what the business wants in some cases.Swap?
I got stuck this afternoon helping out with a query where I needed to add several columns that stored elapsed time.
Easy enough? Sure, except that the person who designed the database stored those elapsed times as the TIME datatype.
And you can't add two time columns. Makes sense, there's no meaning to 11am + 5pm. However in this case 11am meant 11 hours and 5pm meant 17 hours. Cue multiple conversions to datetime followed by DATEPART(mi,...) followed by DATEADD followed by a cast back to TIME.
and how do they store +24 hours in that time column ? (add an extra daycounter column ??) ๐
When can we convert to Metric Time?
Metric time really isn't all that farfetched! You'd have 10 hours in a day, 100 minutes in an hour and 100 seconds in a minute. The only adjustment that needs to to be made is to make the second a little longer than the second is now.
Now that would suck!!!! There would only be 2 hours left in the days after putting in an 8 hour work day. WAIT!! Add the 1 hour for lunch and you only have 1 hour left! WAIT!!! Add 35 minute commute to get to work and ..... I just ran out of time!!!! :w00t:
Excuse me boss, can I leave a few minutes early so I can get back to work on time? ๐
LOL, I think you'd have to change the hours you work. Doesn't a nice 3 hour work day sound great! And imagine the hourly rate you could charge!
--------------------------------------
When you encounter a problem, if the solution isn't readily evident go back to the start and check your assumptions.
--------------------------------------
Itโs unpleasantly like being drunk.
Whatโs so unpleasant about being drunk?
You ask a glass of water. -- Douglas Adams
August 4, 2010 at 12:02 pm
Tom.Thomson (8/4/2010)
Stefan Krzywicki (8/4/2010)
Metric time really isn't all that farfetched! You'd have 10 hours in a day, 100 minutes in an hour and 100 seconds in a minute. The only adjustment that needs to to be made is to make the second a little longer than the second is now.That's the easy bit. But it doesn't really work until the reaction to the tidal effects of the earth's mass on the sun slows the earth's rotation enough so that we have a 100 day year. That won't be for a long time yet, so I don't expect to see decimal time in my lifetime, even if I do manage to get dbcc timewarp to restore the database containing the description of a simple procedure for gaining effective immortality onto my laptop.
Of course I see metric time already - we've had clocks, eggtimers, and sandglasses for a long time now, and I'm not one to allow a bunch of foreigners to usurp a perfectly good word like "metric" and claim it means something that it doesn't.
Now you're talking metric dates and that's different. Remember, in SQL Server 2008 there's separate date and time types, you don't have to lump them all together any more!
--------------------------------------
When you encounter a problem, if the solution isn't readily evident go back to the start and check your assumptions.
--------------------------------------
Itโs unpleasantly like being drunk.
Whatโs so unpleasant about being drunk?
You ask a glass of water. -- Douglas Adams
August 4, 2010 at 12:07 pm
The US hasn't adopted the Metric system yet, so there's very little chance we'll see the date/time system go metric, well, any further than it already is.
Decade, century, and millenium, are decimal based.
For best practices on asking questions, please read the following article: Forum Etiquette: How to post data/code on a forum to get the best help[/url]
August 4, 2010 at 12:11 pm
Jack Corbett (8/4/2010)
GilaMonster (8/4/2010)
Jack Corbett (8/4/2010)
Probably the most complex SQL I've had to write. Too many OUTER JOINs (business requires this design), and then parameters that could turn the OUTER JOINs to INNER JOINs and may not be what the business wants in some cases.Swap?
I got stuck this afternoon helping out with a query where I needed to add several columns that stored elapsed time.
Easy enough? Sure, except that the person who designed the database stored those elapsed times as the TIME datatype.
And you can't add two time columns. Makes sense, there's no meaning to 11am + 5pm. However in this case 11am meant 11 hours and 5pm meant 17 hours. Cue multiple conversions to datetime followed by DATEPART(mi,...) followed by DATEADD followed by a cast back to TIME.
Sure, especially now that you've solved your problem.:w00t:
I've solved one of them. Got several more nice complex date and time related calculations still to do tomorrow. :hehe:
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
August 4, 2010 at 12:12 pm
Alvin Ramard (8/4/2010)
The US hasn't adopted the Metric system yet, so there's very little chance we'll see the date/time system go metric, well, any further than it already is.Decade, century, and millenium, are decimal based.
Good point about longer periods of time.
I'd say the US has adopted the metric system! At least we've adopted it about as well as we've acccepted speed limits.
I'm very much in favor of the standardized calendar. 13 months of 4 weeks each, 7 days a week. At the beginning of the year, you have a holiday that isn't associated with any month called YearDay or NewYearsDay for the traditionalists and you make the holiday a day longer in leap years.
--------------------------------------
When you encounter a problem, if the solution isn't readily evident go back to the start and check your assumptions.
--------------------------------------
Itโs unpleasantly like being drunk.
Whatโs so unpleasant about being drunk?
You ask a glass of water. -- Douglas Adams
August 4, 2010 at 12:59 pm
I vote no. I like my watch. I don't want to have to buy a new one that has 10 digits.
Plus I have this cool clock:
August 4, 2010 at 1:10 pm
Steve Jones - Editor (8/4/2010)
I vote no. I like my watch. I don't want to have to buy a new one that has 10 digits.Plus I have this cool clock:
You know, I'll never understand why people are so willing to say "a quarter of" or "half past", but never say "a third of" or "a sixth after" or "a twelfth after".
--------------------------------------
When you encounter a problem, if the solution isn't readily evident go back to the start and check your assumptions.
--------------------------------------
Itโs unpleasantly like being drunk.
Whatโs so unpleasant about being drunk?
You ask a glass of water. -- Douglas Adams
August 4, 2010 at 1:32 pm
Steve Jones - Editor (8/4/2010)
I vote no. I like my watch. I don't want to have to buy a new one that has 10 digits.Plus I have this cool clock:
Hey, isn't that Phil Factor's clock? ๐
The greatest enemy of knowledge is not ignorance, it is the illusion of knowledge. - Stephen Hawking
August 4, 2010 at 1:45 pm
Alvin Ramard (8/4/2010)
The US hasn't adopted the Metric system yet, so there's very little chance we'll see the date/time system go metric, well, any further than it already is.Decade, century, and millenium, are decimal based.
We should go metric on time only just out of spite. Plus, it would create jobs.
August 4, 2010 at 1:47 pm
mtillman-921105 (8/4/2010)
Steve Jones - Editor (8/4/2010)
I vote no. I like my watch. I don't want to have to buy a new one that has 10 digits.Plus I have this cool clock:
Hey, isn't that Phil Factor's clock? ๐
Doesn't his have like the cube root of 8 on it somewhere?
Or was that 2 to the 3rd power?
I'm not sure about that metric idea - if there are 10 hours in a day, what happens with Military time?
As obsolete as Steve's fancy watch?
Greg E
Viewing 15 posts - 17,086 through 17,100 (of 66,712 total)
You must be logged in to reply to this topic. Login to reply