Viewing 15 posts - 946 through 960 (of 3,480 total)
SELECT y.EventDate
, y.EventHour
, COUNT(*) AS Freq
FROM
(SELECT x.EventDate,
DATEPART(hour,x.EventTime) AS EventHour
FROM
(SELECT '05/17/2019' AS EventDate, '00:51:39.0000' AS EventTime, 1 AS CallCount
UNION ALL
SELECT '05/17/2019', '06:54:34.0000', ...
May 20, 2019 at 6:27 pm
DATEDIFF with a CASE statement should do it.
May 14, 2019 at 4:46 pm
Why not just create a stored procedure to accept two parameters and then do two inserts? Sounds to me like you're making this waaaay more complicated than it should be.
May 9, 2019 at 10:56 pm
Any reason you couldn't take this and turn it into an INSERT statement into a table somewhere?
SELECT TOP 10
GETDATE() AS EventDate,
qs.total_worker_time/(qs.execution_count*60000000) as [Minutes Avg CPU Time], ...
May 9, 2019 at 9:29 pm
Can't help but wonder if the Top 5 change during the day/week. If so, it would make sense to include the execution date/time with the query name in the table....
May 9, 2019 at 8:47 pm
Maybe this? You don't need FILTER() if you are comparing a column value to a constant. You would need it if you were comparing a column to an aggregate.
May 6, 2019 at 8:25 pm
Something like (make a backup of the table or wrap the update in a transaction so you can roll it back...)
UPDATE EmployeeTable
SET EMailAddress = otherTable.EMail
WHERE EmployeeTable.FieldX = OtherTable.FieldY
Basically, you do...
May 3, 2019 at 7:25 pm
If you have only one value per month, then you can use LAG([Inventory],1) OVER (ORDER BY DateArchived) AS PrevValue
and then compare. Maybe easier to do it in T-SQL.
May 1, 2019 at 4:53 pm
Use a Calendar table maybe?
April 30, 2019 at 11:12 pm
Maybe this will help?
You could use multiple REPLACE functions
use tempdb;
go
CREATE TABLE TheReplacements(
Search_Value VARCHAR(15) PRIMARY KEY
, Replace_Value VARCHAR(15) NOT NULL
);
GO
INSERT INTO TheReplacements (Search_Value, Replace_Value)
VALUES ('Timothy','Tim'),('Kathleen','Kathy'),('Joseph','Joe'),('Michael','Mike');
CREATE TABLE People (
PersonID...
April 29, 2019 at 9:40 pm
Oh! I knew it had to be easier than I was making it!
April 29, 2019 at 4:52 pm
For grins, I wrote this in VB.NET (well, sort of)
Public Function FormattedDate (ByVal dtInputDate As Date, ByVal blnShort As Boolean) As String
Dim m As Byte
Dim...
April 27, 2019 at 6:40 am
From what I've read, Language is a report-wide setting. So the only way I could think of doing it is to use either SWITCH or a lookup.
I sort of got...
April 27, 2019 at 4:53 am
If these are EDI files, then you can't just import them. You have to parse those, because the different lines have different meanings/information. Do they have a consistent structure?
April 26, 2019 at 10:19 pm
the one upside to certification is that it may cover things you might otherwise miss. On the other hand, be aware that they don't cover everything. (Damned if you, damned...
April 26, 2019 at 10:15 pm
Viewing 15 posts - 946 through 960 (of 3,480 total)