Viewing 15 posts - 721 through 735 (of 3,489 total)
[col1] = @Value OR [col2]=@Value
?
April 28, 2020 at 3:39 pm
Maybe this one is better?
SELECT x.County
, x.Gender
, x.Members
, y.TotalMembership
, RelPct = CASE WHEN Gender IS NULL THEN NULL ELSE x.Members/(1.0 * y.TotalMembership) END
FROM
(
SELECT
County
,Gender
,members = SUM(ActiveMembers)
FROM...
April 24, 2020 at 8:20 pm
Makes it a lot easier to help if you post consumable data in the form of CREATE TABLE scripts...
use tempdb;
go
CREATE TABLE #SampleData (
County VARCHAR(12) NOT NULL,
Gender CHAR...
April 24, 2020 at 7:15 pm
use the standard ROW_NUMBER() with a windowing function, and then remove any where the ROW_NUMBER() value is not 1?
April 24, 2020 at 6:17 pm
What was it? Use STUFF() or STRING_AGG() with the PARTITION clause?
April 19, 2020 at 2:07 pm
Well, perhaps not, but how else to you capture update events on a table?
April 16, 2020 at 8:21 am
Do you have a trigger on the relevant columns that writes the change info somewhere, or how are you collecting the change information? Awful thin on details.
April 16, 2020 at 4:44 am
unless you have some way to order them in insertion order, you can't. You'd need a column that's either an incrementing identity column or a datetime field with a default...
April 14, 2020 at 9:04 pm
NVARCHAR()??? You sure you need that?
Access Date/Time data type maps to SQL Server Date/Time data type, not DateTime2.
April 14, 2020 at 8:38 am
LOL... Part of the problem is the fact that Access uses VBA to accomplish anything complicated (transactions etc), and uses VBA to manipulate the interface etc. Separating the two might...
April 14, 2020 at 12:23 am
Wendell,
Thanks for answering! I was hoping you would. Super handy list! I'll have to have a read and pass on the links. (Pretty sure I told the OP to post...
April 14, 2020 at 12:21 am
If it were me, I'd do something like this to identify all the tables containing the column I want...
SELECT ao.name AS objectName
, ao.type_desc
, ac.name as ColumnName
FROM sys.all_columns...
April 13, 2020 at 6:02 pm
I just want the first record from TableB.fname returned for each of the 9 results in TableA and then move to the next record.
SELECT A.Col1, A.Col2, BTop.Col1B,...
April 11, 2020 at 7:51 pm
So far so good. Could you post the expected output of the query you need?
April 10, 2020 at 11:39 pm
Viewing 15 posts - 721 through 735 (of 3,489 total)