Viewing 15 posts - 58,861 through 58,875 (of 59,063 total)
Bert,
Thanks for the great compliment! As my follow-up note (long posting above) suggests, you can easily add a reference to a simplified holiday table to the function.
Frank,
Thanks for the tip. ...
--Jeff Moden
Change is inevitable... Change for the better is not.
January 10, 2005 at 6:16 am
As Farrell suggested, you don't need to do the rounding thing because INT will do the rounding for you.
Either of these will work...
SELECT CONVERT(INT,CONVERT(MONEY,'27.49'))
SELECT CAST(CAST('26.50' AS MONEY) AS INT)Obviously, you...
--Jeff Moden
Change is inevitable... Change for the better is not.
January 8, 2005 at 1:14 pm
Great responses, all, folks. Thank you very much for taking the time to make them.
Hmmmm… perhaps the title of the article should have been “Calculating ‘Week’...
--Jeff Moden
Change is inevitable... Change for the better is not.
January 7, 2005 at 10:00 pm
mkeast,
We've all done that before. Thanks for the come back.
--Jeff Moden
Change is inevitable... Change for the better is not.
January 7, 2005 at 7:22 am
Sorry mkeast,
Didn't work the way you expected... here's the output.
col
----------
1
2
3
10
11
2A
2B
3A
3B
3C
I think the original poster wants...
col
----------
1
2
2A
2B
3
3A
3B
3C
10
11
--Jeff Moden
Change is inevitable... Change for the better is not.
January 7, 2005 at 7:00 am
Great idea but I think they really want a custom error message and a check constraint won't do it. Ran into the same problem with permissions... no custom error message.
Switching...
--Jeff Moden
Change is inevitable... Change for the better is not.
January 6, 2005 at 8:04 pm
Like I said, I agree especially in light of that fact that many companies just don't have a documentation system in place. Documentation always seems to take it in the...
--Jeff Moden
Change is inevitable... Change for the better is not.
January 6, 2005 at 7:15 am
I'd think that the "permission denied" message would drive the point home to a developer but, I agree, it might save a couple of trouble calls to the DBA's.
--Jeff Moden
Change is inevitable... Change for the better is not.
January 6, 2005 at 6:41 am
I kind of like Andy's idea... all of the ideas are great ones but it's not really broken. Maybe leave it like it is?
--Jeff Moden
Change is inevitable... Change for the better is not.
January 6, 2005 at 6:16 am
Put the customer error message in the App?
--Jeff Moden
Change is inevitable... Change for the better is not.
January 6, 2005 at 6:13 am
Guess I'll add my two (or is it 3?) cents...
------ Finds the LAST day of CURRENT month with no time element SELECT DATEADD(mm,DATEDIFF(mm,0,GetDate())+1,0)-1 AS LastDayCurrentMonth
------ Finds the LAST day of CURRENT month...
--Jeff Moden
Change is inevitable... Change for the better is not.
January 5, 2005 at 9:23 pm
All of that seems like a fair amout of work to keep a table with only 1 row... why not just log in as the "sa" and revoke insert, update, and...
--Jeff Moden
Change is inevitable... Change for the better is not.
January 5, 2005 at 8:43 pm
Ok, Ken, here ya go...
DATEADD(d,DATEDIFF(d,1,getdate()),0)
DATEDIFF(d,1,getdate()) takes the difference between the current date and 01/02/1900 and converts it to a whole number of...
--Jeff Moden
Change is inevitable... Change for the better is not.
January 5, 2005 at 5:19 am
I'll second that... Frank's method also allows for indexes to be used on the date columns where a conversion sometimes does not.
--Jeff Moden
Change is inevitable... Change for the better is not.
January 4, 2005 at 9:37 pm
Brian wrote: > Feel pretty stupid answering my own question, but I think this does the trick if anyone else is interested. DepDate >= '8/1/04' AND ArrDate =< '8/10/04'
I wouldn't...
--Jeff Moden
Change is inevitable... Change for the better is not.
January 4, 2005 at 9:09 pm
Viewing 15 posts - 58,861 through 58,875 (of 59,063 total)