Viewing 15 posts - 46 through 60 (of 4,087 total)
The fact that you're getting duplicates is an issue with your logic. You haven't given us enough information to troubleshoot the logic, but it's probably do to the fact that...
June 20, 2024 at 2:05 pm
We definitely need more information, because, as currently written, the second table is completely unnecessary.
Drew
June 20, 2024 at 1:42 pm
This gets close to what you want. It uses an ILTV function for the tally table. It essentially uses a running total modulo 2 to determine whether a certain value...
June 6, 2024 at 7:03 pm
This is about as close as you can get using SQL. If you want more control over your formatting, you should use a reporting tool.
SELECT CASE WHEN...
May 14, 2024 at 4:01 pm
I'm not the OP. The UDF (dbo.fnTally) is a well know one by Jeff Moden and the OP is using this in his original post.
The depth...
May 7, 2024 at 3:55 pm
Not sure exactly what you want, but maybe something like this?
Create some data:
-- Creating the table
CREATE TABLE DrillingData (
PROJECT NVARCHAR(50),
...
May 7, 2024 at 2:50 pm
Many people are hesitant to open random files from the Internet. Here is a link on Forum Etiquette: How to post data/code on a forum to get the best...
May 7, 2024 at 1:54 pm
Admittedly your description is a bit vague, but it sounds like you are trying to force SQL into an object-oriented paradigm. For instance you mention "84 data values representing his...
May 2, 2024 at 3:31 pm
I've always thought you should only use inner join if you want to return columns from the other table, but this link suggests join is preferable if there is...
April 16, 2024 at 5:56 pm
This produces the exact same results as Jonathan's query with far fewer reads.
WITH CTE AS
(
SELECT xp.RBDTYR
...
April 11, 2024 at 7:56 pm
The problem is that you chose to create a DENORMALIZED names table. It sounds like you're early enough to change this to NORMALIZED. That will fix your problems.
Drew
April 11, 2024 at 2:22 pm
Please create sample data in a consumable format using the {;} Code
button to include a script to create a TEMP table and insert data into that temp table.
Drew
April 11, 2024 at 2:12 pm
Drew, your solution doesn't list the new company. It only lists the original one. Do you know why?
Yes, there was an error in my code. I was thinking that...
April 4, 2024 at 3:11 pm
Couldn't it be as straightforward as this??
SELECT t.[pick your columns]
FROM SomeTable t
INNER JOIN (SELECT [ID#]
...
April 3, 2024 at 8:15 pm
I used a calculated field to combine these into a single query.
WITH Stop_Fl AS
(
SELECT *
...
April 3, 2024 at 8:06 pm
Viewing 15 posts - 46 through 60 (of 4,087 total)