Viewing 15 posts - 166 through 180 (of 476 total)
Hi
Not sure if I have the rules correct here, but I have applied the following:
Strip anything before and including the first hyphen
Strip anything after and including the second hyphen...
March 7, 2014 at 5:51 pm
And yet another variation:-)
SELECT DISTINCT LEFT(OrderNo, ISNULL(NULLIF(CHARINDEX('-',OrderNo,CHARINDEX('-',OrderNo)+1) - 1,-1),LEN(OrderNo)))
FROM (
SELECT 'SO-123456' AS OrderNo
UNION ALL
SELECT 'SO-123456-01'
UNION ALL
SELECT 'SO-123456-2'
UNION ALL
SELECT 'SO-123457'
UNION ALL
SELECT 'SO-123457-1'
UNION ALL
SELECT 'SO-123457-02'
UNION ALL
SELECT 'SO-123458') x
March 5, 2014 at 7:12 pm
Really that isn't a great deal different from what I posted. My biggest concern is with the portion to parse the date out of the string. RIGHT(Descr, PATINDEX('%[0-9]%',Descr...
March 4, 2014 at 2:26 pm
cesarscorp2 (3/4/2014)
Thanks everybody and excuse me for my bad explication.mickyT is just that I needed. Thanks a million! 🙂
No problem, glad to help
March 4, 2014 at 10:47 am
Hi
You just need to CONVERT back once you've added 14 days, so 'some string' + CONVERT(VARCHAR(8), yourupdateddate,1)
As a note, I would use the DATEADD function and make you pattern...
March 3, 2014 at 4:36 pm
Hi
This looks like a pivot question to me. I've made a couple of assumptions here that may be incorrect, so you may want to change it to suit.
Also have...
March 3, 2014 at 12:51 pm
I wouldn't mind seeing The Dwarves by Markus Heitz done.
+1 on David Eddings series, I think The Redemption Of Althalus would make a great movie
March 2, 2014 at 5:45 pm
mick burden (3/2/2014)
MickyT, can you explainUPDATE POSTCODESTEST SET Location = Geography::Point(Latitude, longitude, 4326)
especially 4326, also how to convert your code into a working SP please
The 4326 reference is...
March 2, 2014 at 11:00 am
Hi
You could wrap your percentage calculation up in an absolute and just check that it's greater than 10.
...
AND ABS((CAST(ProductionCnt.Count AS FLOAT) - CAST(avgcnt.Count AS FLOAT)) / CAST(avgcnt.Count AS FLOAT) *...
February 27, 2014 at 11:06 am
The problem I see with your procedure is that the @mbatch variable is not set to the max.
If you alter your procedure to the following it should work.
CREATE PROCEDURE [prMTRANS_INSERT]
...
February 26, 2014 at 7:13 pm
Hi
You could always use the Geography datatype for this. I've taken your sample and added a primary key, geography column and indexed it. This should work on 2008+.
This...
February 26, 2014 at 11:38 am
The EOMONTH is a function to return the End Of Month. So to return the last six months excluding the current month you could do something like:
WHERE loyaltystartdate >=...
February 21, 2014 at 6:46 pm
How do you want pick you months? It's the 21st Feb, do you want rows from February to be included? Do you want complete months regardless of the...
February 20, 2014 at 11:15 pm
born2achieve (2/20/2014)
Thanks for your reply and from your sample query there is no logic to get last 6 moths data. i just gave the sample data. my actual...
February 20, 2014 at 8:03 pm
Hi
I think a full outer join with a sum on the coalesced values may do the trick for you
with Companyloyalty as (
select 1 as idloyalty, 1000 as company, 100 as...
February 20, 2014 at 6:34 pm
Viewing 15 posts - 166 through 180 (of 476 total)