Viewing 15 posts - 51,181 through 51,195 (of 59,098 total)
DateDiff and DateAdd have the tendency to round to whatever the "date part" is and, despite what many folks think, shouldn't be used to calculate what the difference between full...
--Jeff Moden
Change is inevitable... Change for the better is not.
April 12, 2008 at 12:58 pm
Ok... thanks Tim.
--Jeff Moden
Change is inevitable... Change for the better is not.
April 12, 2008 at 10:43 am
You made the mistake of using ISNUMERIC to check for digits. ISNUMERIC does not equal ISALLDIGITS... try this and see what I mean...
SELECT dbo.check_digit('072---326')
Rather than just have it return...
--Jeff Moden
Change is inevitable... Change for the better is not.
April 11, 2008 at 11:26 pm
You can shrink this down quite a bit...
[font="Courier New"] CREATE FUNCTION CreateABACheckDigit
--===== Created by Jeff Moden
(@RoutingNumber CHAR(8))
RETURNS INT
AS
BEGIN
RETURN (SELECT NULLIF(10-( SUBSTRING(@RoutingNumber,1,1)*3
+ SUBSTRING(@RoutingNumber,2,1)*7
+ SUBSTRING(@RoutingNumber,3,1)*1
+ SUBSTRING(@RoutingNumber,4,1)*3
+ SUBSTRING(@RoutingNumber,5,1)*7
+ SUBSTRING(@RoutingNumber,6,1)*1
+ SUBSTRING(@RoutingNumber,7,1)*3
+ SUBSTRING(@RoutingNumber,8,1)*7)%10
,10))
END
[/font]
--Jeff Moden
Change is inevitable... Change for the better is not.
April 11, 2008 at 11:04 pm
b.carlson (4/11/2008)
The solution was very simple with an array and a couple of functions.Thanks for taking the time to respond.
You could thank us by posting the code you used... 😉
--Jeff Moden
Change is inevitable... Change for the better is not.
April 11, 2008 at 7:31 pm
Read the article at the URL in my signature line... you'll get a lot better help...
--Jeff Moden
Change is inevitable... Change for the better is not.
April 11, 2008 at 7:07 pm
This should really be done in a stored procedure instead of dynamic SQL in a GUI... dynamic SQL in a GUI is a primary source of SQL Injection attacks... and...
--Jeff Moden
Change is inevitable... Change for the better is not.
April 11, 2008 at 6:56 pm
dmizelle (4/7/2008)
--Jeff Moden
Change is inevitable... Change for the better is not.
April 11, 2008 at 6:53 pm
Hmmmm... what kind of index did you put on the TEXT column?
[font="Courier New"]CREATE TABLE EraseMe (ID INT, WTD TEXT)
CREATE INDEX Dodah ON EraseMe (WTD)
Server: Msg 1919, Level 16, State 1,...
--Jeff Moden
Change is inevitable... Change for the better is not.
April 11, 2008 at 6:30 pm
Still not going to help on a DATETIME column... A DATETIME column uses only the default system format when displaying data. If you want something else (should be done...
--Jeff Moden
Change is inevitable... Change for the better is not.
April 10, 2008 at 6:57 pm
I'd rather have more memory so more data can be cached. Also, no matter how fast the processor is, bad code (usually some form of RBAR) is the great...
--Jeff Moden
Change is inevitable... Change for the better is not.
April 10, 2008 at 6:48 pm
alorenzini (4/10/2008)
What would be the best way to get you some sample data?
See the UFL in my signature line for some help on that...
--Jeff Moden
Change is inevitable... Change for the better is not.
April 10, 2008 at 6:33 pm
Ah... thanks for the explanation, Gail... I just figured it out... the reason they need to do the GROUP BY on a comments column is because they're writing an aggregate...
--Jeff Moden
Change is inevitable... Change for the better is not.
April 10, 2008 at 6:58 am
GilaMonster (4/10/2008)
--Jeff Moden
Change is inevitable... Change for the better is not.
April 10, 2008 at 6:49 am
antonio.collins (4/9/2008)
A matrix report will do the pivoting you describe.
Nicely done...
--Jeff Moden
Change is inevitable... Change for the better is not.
April 10, 2008 at 6:07 am
Viewing 15 posts - 51,181 through 51,195 (of 59,098 total)