Viewing 15 posts - 5,851 through 5,865 (of 8,731 total)
I agree with Sean, but I feel that that's not everything that you do on your cursor.
To prevent problems if someone messed up with the data on your table, I...
September 9, 2014 at 8:25 am
And I forgot to post the easy way to do it. :w00t:
SELECT CAST(GETDATE() AS datetime2(0));
September 8, 2014 at 12:43 pm
This might work for you.
DECLARE @Today datetime = DATEADD( dd, DATEDIFF( dd, 0, GETDATE()), 0)
SELECT GETDATE(),
DATEADD( ms,
...
September 8, 2014 at 12:39 pm
The operation varies depending on the data type you expect.
DECLARE @String varchar(4) = '20',
@String2 char(50) = '20',
@int int = 20;
SELECT RIGHT( '0000'...
September 8, 2014 at 8:24 am
I don't. I just validate that there are at least 3 dates within the range. This works if the dates aren't important and you just want to know the companies.
September 7, 2014 at 4:58 pm
Here's a different approach.
WITH MinDates AS(
SELECT CompanyId,
DATEADD( dd, -15, MAX(ActivityDate)) MinDate
FROM ActivityTable
...
September 7, 2014 at 3:39 pm
Eirikur Eiriksson (9/7/2014)
Just a thought, what about the ability to rate questions? Could be something like "splendid question" all the way down to "interesting" or "PICNIC".😎
Isn't that what this...
September 7, 2014 at 1:19 pm
This is like torture. I'm at the office, unable to watch the first games of the NFL season and can only see all the spam promoting supposed pages to watch...
September 7, 2014 at 11:04 am
baijuep (9/7/2014)
Msg 8120, Level 16, State 1, Line 1
Column 'Trade.Trade' is invalid in the select list because it is not...
September 7, 2014 at 10:56 am
The problem is that when you insert the value into NEWCOLUMN, you're inserting NULLS and default values in the other columns to complete the row.
If you have a PK...
September 7, 2014 at 10:15 am
I don't understand your problem. What's PL, KM, KT? How do you define the first and the second row? There's no default order on SQL.
Your query seems inefficient. You could...
September 7, 2014 at 7:39 am
Eirikur Eiriksson (9/4/2014)
Luis Cazares (9/4/2014)
batgirl (9/4/2014)
Lynn Pettis (9/4/2014)
I liked the COBOL reference...
September 5, 2014 at 6:44 pm
This solution is an alternative which might be better or might be worse. It can be complicated because each column requires 7 functions and it won't work with 5 columns....
September 5, 2014 at 5:09 pm
You could do it in the same EXEC() statement. The problem is that you need to be sure that you're generating the same columns or you'll get an error.
Here's an...
September 5, 2014 at 3:16 pm
I'm sure that it won't return what you expect.
You're ordering by the individual sales order detail and not the total of the month.
You shouldn't be using functions on the columns...
September 5, 2014 at 11:35 am
Viewing 15 posts - 5,851 through 5,865 (of 8,731 total)