Viewing 7 posts - 1 through 7 (of 7 total)
March 15, 2018 at 6:58 am
To get the first of the previous month:-declare @firstofprevmonth date = datefromparts(year(dateadd(month,-1,getdate())), month(dateadd(month,-1,getdate())), 1)
And the last day:-declare @lastofprevmonth date = eomonth(@firstofprevmonth)
Putting...
March 14, 2018 at 5:01 pm
This should do the trick:-
UPDATE m
SET
Field1 = COALESCE(Field1,(SELECT TOP 1 Field1 FROM chld c WHERE c.custid = m.custid AND Field1 IS NOT NULL...
September 9, 2017 at 2:49 am
You should use CONVERT
USE [reporting_database]
GO
INSERT INTO [dbo].[Converted_Agreement]
SELECT
CONVERT (char(10),Dates,126)
FROM [dbo].[Agreement]
GO
May 2, 2017 at 3:58 am
You could try something like this:-
select coalesce(convert(varchar,[Days Since Account Logon]),'Unknown') as [Days Since Account Logon]
But I agree with the rest, you shouldn't be doing...
May 2, 2017 at 3:41 am
Thanks for your feedback - great question too! I completely agree with you that triggers are a more complete solution, but this is such a handy technique I figured it...
May 2, 2017 at 3:14 am
Thanks Steve - wasn't aware it did this..
May 2, 2017 at 2:06 am
Viewing 7 posts - 1 through 7 (of 7 total)