Well, I believe I have worked it out on my own. Perhaps not the best way, but it appears to work.
CREATE function [dbo].[fn_TermPeriods]()
Returns table
as
RETURN
(
Select 1 as Number
UNION
Select 2 as Number
UNION
Select 3 as Number
UNION
Select 4 as Number
UNION
Select 5 as Number...
Hello Andrzejek,
The terms are to be true 12 months, what you have identified is actually an artifact of the source system where it computes everything as being 1 day too long. The final product will have the enddate shortened by one day. I missed this in the example I provided.
However...
Hello everyone,
Need some guidance on how best to approach this. I have data where I am presented with the following
Contract ContractStartDate ContractEndDate
A-S00027491 2020-08-06 00:00:00.000 2022-08-06 00:00:00.000
A-S00027526 2020-08-13 00:00:00.000 2022-08-13 00:00:00.000...
Hello everyone, and thank you in advance for your help.
I have JSON files that I am working on importing into SQL. I am able to access the general data, but there is some data where it contains an Array of data (just a listing) which may be 0 rows, or 100. I am unable to determine how to...
I have a requirement to parse apart a field of data that is separated by a semi-colon, to do some work on the individual results (transform based on a case statement), and then to reassemble so that they are in the format of (value; value; value).
I can separate and perform the case statement...
George, thank you incredibly... and Yes I am now kicking myself. :)
For the life of me i could not figure out why this was occuring.
A follow on Question to this, if I may. When I return the results for this query, I need to associate the Question_PK Column from the originating table so I can...
George,
Here are the answers you requested.
Datatype = ntext
Version=9.00.4035.00
Value=
<optionList><option shuffle="0" isCorrect="0"><text ident="1"><B>A.The brakes and steering failed...
George, I apparently missed that when I typed it in here, my apologies. I utilized your example however and I am still returning no values.
If I simply perform Select * from @MyXML then it shows the values, but not if I try to grab node values.
Any thoughts?
Hello everyone,
I have run into a couple of problems that are baffling me. I am able to select XML data if the variable @MyXML is populated using text and a SET command, but if I populate @MyXML using a select statement it will not allow me to parse the variable and return results.
For...
Hello everyone,
I have a Matrix Report written in 2005 where the Matrix/columns is Dynamic.
I am experiencing an issue where the report renders correctly, it exports to other formats correctly, however.... when Printing only the first 6 columns of the Matrix display their labels. The...
Hello everyone, first of all thanks for your help up front.
I have a complex update statement that runs once a month against a large db, it was never very fast but we recently moved from SQL 2000 to 2005. The speed has drastically decreased, and it is filling up the Tempdb. On occasion the...
RiverGuy, Thank you very much. I had just developed a similar answer right before you responded.
By code is as follows:
DECLARE @Months TABLE (Date datetime)
DECLARE @i int
DECLARE @MaxiD int
SELECT @MaxId = datediff(month, '2008-09-01', getdate())
SET @i = 0
WHILE @i <= @MaxId
BEGIN...
The number of months will change depending on the current date, as provided by getdate(). So while it is currently 2, in December it will be 3, in January 4, etc.
The point is, I need to create a class for each month from September 2008 until whatever the current date is. Whether that be 2...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.