Viewing 15 posts - 256 through 270 (of 1,156 total)
It tough to exactly give you the right code, but you could do something like this:
Code to view the results in question:
SELECT MyColumn = REPLACE(MyColumn,',','')
FROM MyTable
WHERE CHARINDEX(',',MyColumn) > 0
The code...
March 20, 2008 at 11:46 am
Sometimes you have a case where 90% of the logic is the same, however, you have to do one thing different if it is an INSERT vs UPDATE, etc. ...
March 20, 2008 at 11:40 am
You can also use the left function.
Master_Address =
RTRIM(LEFT(Master_Address, Len(Master_Address)-2)
March 19, 2008 at 5:03 pm
You need to use a case statement in you where clause. This queries assumes that you want the number of days to be the same. You can incorporate...
March 18, 2008 at 3:59 pm
Then use the code I posted earlier.
CASE
WHEN SUM(v.PurchaseAmount) /15000 <=0 THEN 0
WHEN SUM(v.PurchaseAmount) /15000 > 0 AND SUM(v.PurchaseAmount) /15000 < 1 THEN 0
ELSE SUM(v.PurchaseAmount)/15000
END as 'TotalPersonalSalesCalculatedPoints'
March 18, 2008 at 3:50 pm
Well I take it as between 0 and 1. Is that what you meant?
March 18, 2008 at 3:28 pm
Is this not a requirement anymore? 0.0243 would fall into this category.
Exactly. If the Purchase amount is less than a whole number then I want to see a 0....
March 18, 2008 at 3:27 pm
How about:
CASE
WHEN SUM(v.PurchaseAmount) /15000 <=0 THEN 0
WHEN SUM(v.PurchaseAmount) /15000 > 0 AND SUM(v.PurchaseAmount) /15000 < 1 THEN 0
ELSE SUM(v.PurchaseAmount)/15000
END as 'TotalPersonalSalesCalculatedPoints'
March 18, 2008 at 3:20 pm
I don't mean to sound condescending but...
Based on your sample data, 0.02343 , that values is NOT less than zero. Values such as -1, -3.1415 are less than zero....
March 18, 2008 at 3:00 pm
What is suppose to happen is that if the PurchaseAMount is < the 0 then I just want to display a 0 in the column but it keeps giving me...
March 18, 2008 at 2:57 pm
I am glad everything worked out. As a piece of advice, before doing anything to the master database, back it up. The instance cannot run without this database.
March 18, 2008 at 10:04 am
If you're not on the latest service pack then the reports are viewable from the summary tab in ssms. Select the summary tab, select a database and then the...
March 18, 2008 at 9:54 am
I am confused by this part
Set @TodayDate = DateName(dw,@EndTime)
Wouldn't you want @TodayDate to equal the day of the week for today's...
March 18, 2008 at 9:51 am
SSMS is SQL Server Management Studio
What service pack is your instance on? I think you need to be on service pack 2.
March 18, 2008 at 9:40 am
Viewing 15 posts - 256 through 270 (of 1,156 total)