Viewing 15 posts - 2,476 through 2,490 (of 7,608 total)
I only filled in holidays / weekends for Jan, but this code should give you what you requested once you substitute in your own nonworkdays table.
;WITH base_data...
February 21, 2020 at 8:42 pm
For a direct, single table update, the alias shouldn't be needed.
If the FROM clause with the same table name appears, or especially if there any JOINs, it's absolutely critical to...
February 21, 2020 at 5:39 pm
I am not sure exactly what you mean.
What specifically do you/we need to do with column RE80_DATAMOV?
February 21, 2020 at 5:24 pm
FYI, you can do it without creating a table, like so:
SELECT
SQL_VARIANT_PROPERTY ( MyColumn2, 'BaseType' ) AS MyColumn2_BaseType,
SQL_VARIANT_PROPERTY ( today,...
February 21, 2020 at 3:59 pm
SELECT SUM(TRY_CAST(LEFT(RE80_VALORE, CHARINDEX('.', RE80_VALORE + '.')) AS int))
FROM dbo.RE80_MOVSCHPUNTI
February 21, 2020 at 3:55 pm
I think it's a bit more complex than that, at least if you want to keep existing code. Personally I would not try rewrite all existing INSERT(s) / UPDATE(s) on...
February 19, 2020 at 9:17 pm
I'd create completely new tables.
One table to hold all the varchar values and their new int value, as you're already done, I'm sure. Load it with all the distinct values...
February 19, 2020 at 6:29 pm
<Is it true that for those reasons he/ I could not do this?>
No, SQL Server would never allow one file to be used by two different dbs at the same...
February 18, 2020 at 10:54 pm
Less than four functions, anyone?
SELECT string, numbers
FROM ( VALUES
('Total # of bytes : 128270200832 (119.46GB)'),
('Total # of bytes...
February 18, 2020 at 5:13 pm
To allow for some variations in the format:
SELECT string, numbers
FROM ( VALUES
('Total # of bytes : 128270200832 (119.46GB)'),
('Total #...
February 18, 2020 at 3:29 pm
Select p.PREmp, p.PRDept, 0 As [Admin]
From Payroll p
UNION ALL
Select h.PREmp, p.PRDept, 1 As [Admin]
From HR h
cross join (
select distinct PRDept
...
February 17, 2020 at 10:57 pm
How's about this instead?!:
SELECT
us.Name
,SUM(wl.HoursWorked) / COUNT(DISTINCT us.TeamID) AS HoursWorked
FROM Users us
INNER JOIN WorkLog wl ON wl.UserKey = us.UserKey
GROUP BY...
February 17, 2020 at 8:08 pm
WHEN 'SCC' THEN CONCAT(' (', CAST(ROUND([Column], 0, 1) AS int), ' ', nestedTempTableAlerts.[Threshold_Value], ')')
February 17, 2020 at 7:22 pm
SELECT value AS original_value,
CAST(ROUND(value, 0, 1) AS int) AS value0,
CAST(ROUND(value, 2, 1) AS decimal(9, 2)) AS value2,
CAST(ROUND(value, 1, 1) AS decimal(9, 1)) AS value1
FROM ( VALUES(100.199) ) AS test_data(value)
February 17, 2020 at 5:58 pm
That code is for one row, so whatever values you are INSERTing for the current row contains the key(s).
For multiple rows / a batch of rows, yes, you would initially...
February 13, 2020 at 6:52 pm
Viewing 15 posts - 2,476 through 2,490 (of 7,608 total)