Viewing 15 posts - 58,516 through 58,530 (of 59,067 total)
Andrew... This also works... and, it's set based.... just substitute a column name for @Number in the formula...
-- Math.Round(3.454,2) -> 3.45
-- Math.Round(3.455,2) -> 3.46
-- Math.Round(3.445,2) -> 3.44
-- Math.Round(3.456,2)...
--Jeff Moden
Change is inevitable... Change for the better is not.
December 27, 2005 at 11:10 am
If you mean round to the nearest whole number, then simply converting to INT will do...
DECLARE @Amount1 MONEY
SET @Amount1 = 7.49
DECLARE @Amount2 MONEY
SET @Amount2 = 7.50
DECLARE...
--Jeff Moden
Change is inevitable... Change for the better is not.
December 25, 2005 at 9:45 pm
You bet... Merry Christmas.
--Jeff Moden
Change is inevitable... Change for the better is not.
December 25, 2005 at 9:25 pm
You are new at this...
Try this, Josh...
UPDATE yourtable
SET Name = RTRIM(SUBSTRING(Subject,1,CHARINDEX('#',Subject,1)-1)),
Paid = RTRIM(SUBSTRING(Subject,CHARINDEX('#',Subject,1),
CHARINDEX('$',Subject,1)-CHARINDEX('#',Subject,1))),
Amount = RTRIM(SUBSTRING(Subject,CHARINDEX('$',Subject,1),
CHARINDEX('/',Subject,1)-CHARINDEX('$',Subject,1))),
CheckNo = RTRIM(SUBSTRING(Subject,CHARINDEX('/',Subject,1)+1,999))
FROM yourtable
And, let's hope...
--Jeff Moden
Change is inevitable... Change for the better is not.
December 25, 2005 at 7:13 am
I'm thinking... REFRESH, REFRESH, REFRESH again.
--Jeff Moden
Change is inevitable... Change for the better is not.
December 24, 2005 at 12:35 pm
Assuming that the column you are parsing is called "ParseThis" and your table name is called "yourtable", this will work PROVIDED that you always have all 4 parts...
SELECT...
--Jeff Moden
Change is inevitable... Change for the better is not.
December 24, 2005 at 12:31 pm
No, but I'm thinking that this is "Death by SQL" of the same magnitude as disabling the automatic recalculation of statistics.
--Jeff Moden
Change is inevitable... Change for the better is not.
December 24, 2005 at 12:08 pm
"Books Online" describes both FLOAT and REAL as follows:
"Approximate number data types for use with floating point numeric data. Floating point data is approximate; not all values in the data...
--Jeff Moden
Change is inevitable... Change for the better is not.
December 24, 2005 at 12:04 pm
If your job only runs on Saturday, then you've done it the most efficient way.
--Jeff Moden
Change is inevitable... Change for the better is not.
December 24, 2005 at 11:52 am
Carl, sometimes there's just no application to be had... SQL is it.
Mark, the reason you are getting the error is that you must either have SA permissions or your DBA...
--Jeff Moden
Change is inevitable... Change for the better is not.
December 22, 2005 at 12:41 am
Very cool, jratwork... I have a similar un-natural aversion to correlated subqueries and I had my doubts when I saw the "<" in the correlated subquery... but I just ran...
--Jeff Moden
Change is inevitable... Change for the better is not.
December 20, 2005 at 5:18 pm
First, this isn't a DB2 forum and not all SQL's are created equal. That, notwithstanding, you say "it didn't work"... if you got an error message, is sure would be...
--Jeff Moden
Change is inevitable... Change for the better is not.
December 19, 2005 at 11:10 pm
"Online AnonProfile" seems a bit paranoid as a "handle" to me
... whatever...
This little ditty should help you in your quest for primary...
--Jeff Moden
Change is inevitable... Change for the better is not.
December 19, 2005 at 10:59 pm
You can't do this with a constraint... you'll need to use a trigger or, maybe, you can also try a "calculated column".
--Jeff Moden
Change is inevitable... Change for the better is not.
December 19, 2005 at 9:28 pm
Can you run the following?
EXEC Master.dbo.xp_CmdShell 'Dir C:\'
If not, your SYSADMIN got the "religion of security" and disabled access to xp_CmdShell.
--Jeff Moden
Change is inevitable... Change for the better is not.
December 19, 2005 at 9:24 pm
Viewing 15 posts - 58,516 through 58,530 (of 59,067 total)