Viewing 15 posts - 781 through 795 (of 1,396 total)
After the update the code could look something like this
drop TABLE if exists #Invoices
go
CREATE TABLE #Invoices(
[InvoiceID] [int] IDENTITY(1,1) NOT NULL,
[InvoiceDate] [smalldatetime] NULL,
[Total] [decimal](18, 2) NULL,
CONSTRAINT [PK_Invoices] PRIMARY...
December 9, 2020 at 3:45 pm
The lazy programmers' way to delete from complex data structures is to get a data comparison tool to generate the SQL DELETE transaction. Where I work we've used 2 different...
December 9, 2020 at 2:56 pm
Steve... the OP has posted in a 2005 forum which is before SUM() OVER had the ability to produce a running sum. I'm thinking we're going to need another...
December 9, 2020 at 1:41 pm
You could try something like this
drop table if exists #MyTempTable
go
create table #MyTempTable(
EE int not null,
EffDate ...
December 9, 2020 at 2:09 am
When "trying to get all combinations..." it usually means CROSS JOIN. In this case the distinct year/month dates are selected in the CTE. Then the CTE is 'row multiplied' or...
December 3, 2020 at 2:56 am
Oh wait I think I see what you're saying now. It should subtract 2 days from the current month 2nd Thursday to compare with the current date. The query could...
November 30, 2020 at 11:01 pm
It depends on what the "today" date is, no?
CASE 2 - If Today is 1 Dec 2020 - Then, The output should be (12 Nov 2020) -
Reason, 10 Dec 2020...
November 30, 2020 at 10:45 pm
Here's a tvf
drop function if exists dbo.fn_test_scnd_thurs;
go
create function dbo.fn_test_scnd_thurs(
@test_date date)
returns table
as return
select dateadd(day, 9, calc_dt.dt)...
November 30, 2020 at 10:06 pm
I had to take down the previous post because I found a bug in the formula. Looking for how to fix it.
Ah I didn't see what was posted. My...
November 30, 2020 at 4:21 pm
Steve, if you're going to use the fnTally function, you need to tell people where to get it. Since I use it so often, I just put the link...
November 30, 2020 at 4:16 pm
Even if fnTally is not available it's still a useful article to read. Any table with reliably more than 31 rows could be used tho. In this case I created...
November 30, 2020 at 4:13 pm
When you write "which is followed with..." it seems you're intending it to mean "which follows the..."? The following has 2 Common Table Expressions: 1) 'test_tues_cte' which contains all of...
November 30, 2020 at 2:00 pm
The JSON is oddly formed. Are you 100% sure this is the format required? The inner JSON items are in array list format but there's no array wrapper. I don't...
November 28, 2020 at 2:04 pm
One way or another I would like to come up with a way to deal with JSON schemas. If I observe how my time is spent and do the "5...
November 25, 2020 at 6:59 pm
but my point is that I don't want to assign a value to a variable to start creating hierarchies for all accounts in my chart of accounts. Any ideas...
November 20, 2020 at 6:31 pm
Viewing 15 posts - 781 through 795 (of 1,396 total)