Viewing 15 posts - 1 through 15 (of 33 total)
Please appreciate we are all volunteers here with our own jobs, hobbies, families, etc. This is a relatively complicated concept for someone new to sql. You may need to put...
December 14, 2023 at 8:07 pm
Ok, makes sense. I think you need to partition by employee_id:
drop table if exists #t
select 1 as payroll_detail_id, 1 as payroll_id, 1 as employee_id, 2 as...
December 14, 2023 at 5:53 pm
So for payroll id of 3 (employeeID 1 ) you want to get data from the record payroll_detail_id 1 ? Do you want to get all records for that employee...
December 14, 2023 at 5:21 pm
Will the lag window function help?
https://learn.microsoft.com/en-us/sql/t-sql/functions/lag-transact-sql?view=sql-server-ver16
December 14, 2023 at 5:01 pm
Hi, We figured out how we are going to handle this-- keep the StartDate / EndDate as a datetime and change the values to the beginning of the day meaning...
January 21, 2023 at 5:41 pm
Thanks for the response Steve Collins.
I wasn't clear in my question. We write the start date of the customer dimension record as a date time, in the example the StartDate...
January 17, 2023 at 10:26 pm
Thanks for the response Michael. There are many more attributes in our customer table than just sales rep id. The customer surrogate key s/b the only key in the fact...
January 17, 2023 at 9:10 pm
declare @text varchar(100) = 'Southeri,Brettuen'
select @text, Replace(@text, ',' ,', ')
April 20, 2022 at 2:58 am
You are welcome. I learned something, too, from Mark C’s solution
February 28, 2022 at 6:41 pm
Here is what I would do. There may be a different way--without having to "hardcode" every path--but I don't know of one.
DECLARE @doc XML
SET @doc =' ...
February 25, 2022 at 11:05 am
I'm not sure how much control you have over the xml, I reformatted it a bit and here is how I would do it:
declare @x xml =...
February 25, 2022 at 2:10 am
Cool, glad I could help. I’ve certainly received quite a bit of help from this forum.
🤙🏼
February 23, 2022 at 2:42 pm
perhaps this will help...
DROP TABLE if exists #batch
create table #batch (batchID int IDENTITY(1,1),
...
February 22, 2022 at 11:25 pm
Try this:
drop table if exists #testAddress
CREATE TABLE #testAddress(
[ID] [int] NULL,
[houseNum] [int] NULL,
[streetNm] [varchar](50) NULL,
[StreetType] [varchar](5) NULL,
[aptno] [varchar](10) NULL,
[fullstreet] [varchar](100) NULL
)
INSERT #testAddress ([ID], [houseNum], [streetNm], [StreetType],...
February 12, 2022 at 7:43 pm
Thanks for the interesting problem... Perhaps consider something like this:
SELECT ID, b.[value] bVal , .ordinal bOrd, CASE WHEN CHARINDEX ( ',', fullStreet ) = 0 THEN ''
ELSE...
February 12, 2022 at 8:52 am
Viewing 15 posts - 1 through 15 (of 33 total)