Viewing 15 posts - 376 through 390 (of 1,229 total)
sqlbi.vvamsi (1/22/2013)
this should sufficedeclare @mn money=-1000000
select replace(CONVERT(varchar(50),@mn,1),'.00','') as mn
No, that's "Western" format. The OP requires Indian format. This Wiki article gives a good explanation.
January 22, 2013 at 2:32 pm
WolfgangE (1/14/2013)
The disadvantages using the cross-apply-method I see are performance and maintenance:
If the number of rows of the outer select increases the query will slow down as the apply-operator does...
January 14, 2013 at 5:39 am
Hi Paul
Your sample data set doesn't have a matching row between MG_VSLVOY_HEADER and MG_VSLVOY_PORT_CONTROL:
SELECT ncv.*, vh.VSLVOY_HEADER_ID
FROM NCV_BL ncv
JOIN MG_VSLVOY_HEADER vh
ON ncv.saisan_VESSEL_CD = vh.VESSEL_CD
AND ncv.saisan_VOYAGE_CD = vh.VOYAGE_NUM
AND ncv.saisan_LEG_CD =...
January 13, 2013 at 2:06 am
select x.NewSid, sid
from tbl_xenix
CROSS APPLY (SELECT NewSid = ('S'+CAST ([statusId] AS VARCHAR(255)))) x
order by CHARINDEX(x.NewSid,'S5S4')
January 13, 2013 at 1:39 am
terrygefael (1/5/2013)
I have a simple table with 29 fields(unique id, 14 True/False, 14 text)
I want to find all fields relating to one unique ID that are true.
Example:
SELECT...
January 6, 2013 at 12:44 am
Use CROSS APPLY.
SELECT
x.Results1,
CASE WHEN x.Results1 > 42 THEN ...
FROM ...
CROSS APPLY (SELECT... VERY LONG FORMULA as Results1) x
WHERE x.Results1 =...
January 5, 2013 at 11:55 pm
Read the link in my sig (please read this) to see how to generate and post readily-consumable sample data. If folks can get to work on your problem using cut-and-paste...
November 4, 2012 at 12:58 pm
Where in this code do you populate table #sid?
sqldba_newbie (10/28/2012)
October 28, 2012 at 11:54 am
jrichards54 (10/28/2012)
October 28, 2012 at 10:48 am
L' Eomot Inversé (10/27/2012)
L' Eomot Inversé (10/26/2012)
WayneS (10/25/2012)
Anyone still alive out here? 3 days with no comments... that has to be a record for The Thread.
Some malware has reduced my...
October 28, 2012 at 5:58 am
Revenant (10/27/2012)
crookj (10/26/2012)
Brandie Tarvin (10/26/2012)
RatBen
MJ song
October 28, 2012 at 5:17 am
scarlam (10/24/2012)
Any ideas on how to go about writing a script or stored procedure that can loop through this table.
You're a programmer, you work to a specification -...
October 28, 2012 at 5:06 am
dthmtlgod (10/15/2012)
I only want the records with a 1 and not a 5 status
;WITH SampleData (TICKET, [STATUS]) AS (
SELECT 9543, 1 UNION ALL
SELECT 9543, 5 UNION ALL
SELECT 9543, 5 UNION...
October 28, 2012 at 4:24 am
Don. (10/28/2012)
ChrisM@home (10/28/2012)
Thanks for the feedback, Don. The script in bold - is it the 2000-compatible one?
Morning Chris,
It was the following script you gave me help with:
SELECT c.*, h.* ...
October 28, 2012 at 4:15 am
Don. (10/28/2012)
ChrisM@home (10/17/2012)
Eric M Russell (10/15/2012)
If Don has time, it would be interesting to know how this triangular join method compares to the aggregate methods. With small partitions it could...
October 28, 2012 at 3:54 am
Viewing 15 posts - 376 through 390 (of 1,229 total)