Viewing 15 posts - 1,261 through 1,275 (of 2,007 total)
Jeff Moden (11/29/2011)
Cadavre (11/29/2011)
November 29, 2011 at 5:44 am
JayK (11/29/2011)
I've been given the task of coming up with a query to allow our company send out emails to our customers based on their geographical location and order history,
Example...
November 29, 2011 at 5:42 am
The issue is what do you do when you have an invalid date? With the data being stored as VARCHAR, you almost certainly will have some invalid dates in there...
November 29, 2011 at 5:21 am
koolme_85 (11/28/2011)
so total 3 distinct guids for 5 recordscan any one help me on this one ?
thanks
regards
greg
Guess based on your data.
BEGIN TRAN
--Sample data as show by the OP
DECLARE @TABLE...
November 29, 2011 at 4:47 am
Guess based on your data -
BEGIN TRAN
--First, let's build some sample data
DECLARE @tmpOutput AS TABLE (ContractDate DATETIME, ItemId CHAR(6), StartDate DATETIME,
EndDate DATETIME, W_Loc CHAR(3), CollectedGoods INT, HaulageRate MONEY)
INSERT INTO...
November 28, 2011 at 8:50 am
This is more difficult than the previous version by a fair way. Before, I simply generated a "CASE" statement to find the string.
With the new version, I'm looking at doing...
November 28, 2011 at 6:38 am
The best way would be a calendar table.
http://www.sqlservercentral.com/articles/T-SQL/70482/
http://www.sqlservercentral.com/articles/T-SQL/70743/
http://www.sqlservercentral.com/articles/Test-Driven+Development/71075/
Otherwise you're left with a nice big formula that can only return the last week-day of the month but doesn't adjust for holidays.
DECLARE...
November 28, 2011 at 5:22 am
SQL_By_Chance (11/28/2011)
Thanks Cadavre,Wish you many more centuries for providing the solution.
Thanks,
Ankit
Bear in mind that my solution is going to die a horrible death on a real table with even a...
November 28, 2011 at 4:21 am
SQL_By_Chance (11/25/2011)
The data is normalized but I have concatenated fields separated by "/"
Hope that CELKO doesn't see that comment 😉
SQL_By_Chance (11/25/2011)
I wanted to know if it was possible without splitting.
So...
November 28, 2011 at 3:21 am
methexis (11/25/2011)
I have already used this method on 2 other queries and it works a treat, not to mention nice and fast!
I cant thankyou enough for your help today.
Have...
November 25, 2011 at 10:00 am
LutzM (11/25/2011)
There's only one person being able to answer that 😉
Agreed.
November 25, 2011 at 9:54 am
LutzM (11/25/2011)
@Cadavre: Your code returns 2011-10-31 which is not part of the expected result.
He added the 31st when you mentioned that he didn't actually need to "distinct-tify" his two columns....
November 25, 2011 at 9:39 am
methexis (11/25/2011)
Now I don't just want to take the code and go on my way. When I first attempted to do this I used a 'Where' clause to find...
November 25, 2011 at 9:33 am
Smash125 (11/25/2011)
Fairly simple steps i have given.
OK, I'm going to paraphrase an article for you.
Am...
November 25, 2011 at 7:39 am
Smash125 (11/25/2011)
i am using below query to generate report
WITH C AS
(
SELECT YEAR(OrderDate)...
November 25, 2011 at 7:25 am
Viewing 15 posts - 1,261 through 1,275 (of 2,007 total)