Viewing 15 posts - 151 through 165 (of 276 total)
I would like to suggest that the title of this thread be changed to:
Are the posted questions getting worser?
July 30, 2014 at 6:10 pm
UPDATE GLAMF
SET Activesw = 0
WHERE ACCTID NOT IN
(SELECT ACCTID from GLPOST)
July 30, 2014 at 5:55 pm
IF object_id('tempdb..#TimeTicket') IS NOT NULL
DROP TABLE #TimeTicket
CREATE TABLE #TimeTicket
(
employeeIDINTNOT NULL,
TotalHoursDECIMAL(4,2)NOT NULL
)
INSERT INTO #TimeTicket (employeeID, TotalHours)
SELECT 100, 13 UNION ALL
SELECT 200, 11 UNION ALL
SELECT 300, 7 UNION ALL
SELECT 400, 23.25 UNION...
July 29, 2014 at 1:28 pm
Even with the...
AND CTE1.item = CTE2.item
...in the join?
It seemed to work okay. Did I screw something up?
July 28, 2014 at 4:14 pm
If I'm understanding correctly, here's what I'd do in this situation:
IF object_id('tempdb..#foo') IS NOT NULL
DROP TABLE #foo;
CREATE TABLE #foo (item CHAR(1), changedate DATETIME, value INT);
INSERT #foo (item, changedate, value)
VALUES ('x',...
July 28, 2014 at 3:56 pm
select
MethodDate,
Method
from
@TestData
where
Method = 'A'
UNION ALL
select top 1
MethodDate,
Method
from
...
July 28, 2014 at 3:38 pm
When someone solves your original question, there is a button you can click on that post to "mark as solution", that's all I meant.
As for your next question, I...
July 23, 2014 at 4:56 pm
Glad I could help. You can mark that post as the solution if you're all set. 🙂
July 23, 2014 at 4:44 pm
I have no idea what FavUnfavCostChange is, but would it help to cast it as a specific data type?
CASE
WHEN CAST(SUM(FavUnfavCostChange) AS DECIMAL(10,2)) < 0.02 THEN...
July 23, 2014 at 4:41 pm
I'm pretty sure that's what I thought you meant. Are you sure my code isn't working right? I am adding the current month's ACTIVITYDEBIT to the previous month's Last_Trail_Balance_Debit.
July 23, 2014 at 4:22 pm
Here's another version that I guess might be a bit more efficient? Only uses 2 CTE's instead of 4.
DECLARE @Employee TABLE (EmployeeID INT, EmployeeName VARCHAR (100), EmployeeDOB DATETIME)
INSERT INTO @Employee...
July 23, 2014 at 4:13 pm
P.S. If you have any situations where a record in @Employee won't also exist at least once in the two other tables, you will want to use LEFT OUTER JOIN...
July 23, 2014 at 4:01 pm
How can the users run scripts to UPDATE tables if they can't even use table variables or temp tables?
July 23, 2014 at 3:51 pm
I'm not sure if I'm understanding you, but does this do what you want?
IF OBJECT_ID('TempDB..#MyTrialBalance','U') IS NOT NULL
DROP TABLE #MyTrialBalance
CREATE TABLE #MyTrialBalance (
[Trial_Balance_ID] [int] IDENTITY(1,1) PRIMARY KEY CLUSTERED NOT NULL,
[FISCALYEAR]...
July 23, 2014 at 3:49 pm
Viewing 15 posts - 151 through 165 (of 276 total)