Viewing 15 posts - 31 through 45 (of 388 total)
Thanks! One thing what if I need to add a field like [Date] (which I may want to do grouping on later)? It wants this added to the 'group by'...
December 6, 2021 at 3:33 pm
I can get the full name with this:
,LTRIM(RTRIM(SUBSTRING([user_name], CHARINDEX(')', [user_name]) + 1,
PATINDEX('%[+-][0-9]%', [user_name]) - (CHARINDEX(')', [user_name]) + 1))))
December 2, 2021 at 7:57 pm
That works and makes sense! Thanks!
November 23, 2021 at 5:59 pm
This is working:
SELECT * FROM (SELECT
c.clientname as 'Client',
c.BillingRateA as 'Rate',
b.BillingTypeA as 'Unit',
...
November 18, 2021 at 10:07 pm
Both BillingRateA and BillingRateB are decimal
CREATE TABLE [dbo].[Client](
[ClientID] [int] IDENTITY(1,1) NOT NULL,
[ClientName] [varchar](50) NOT NULL,
[MarketSegmentID] [int] NULL,
[BillingTypeA] [int] NULL,
[BillingRateA] [decimal](8, 2) NULL,
[BillingTypeB] [int] NULL,
[BillingRateB] [decimal](8, 2) NULL,
November 18, 2021 at 9:35 pm
November 18, 2021 at 9:20 pm
BillingRateB and BillinRateA are decimal. 49 rows are returned and there are 41 records in the table of which 8 in question do have a BillingRateB (and BillingRateA), but all...
November 18, 2021 at 8:56 pm
How can I pass in the date as a variable in the dynamic part of the SQL?:
--below is close but not working:
declare
@ColumnNames nvarchar(max),
...
November 3, 2021 at 7:11 pm
What is the code for the function DelimitedSplit8K?
October 29, 2021 at 7:34 pm
This less than eloquent way works until I get a name like (t) Robert Hester -15421 :
Select Ltrim(SubString([agent name],1,Isnull(Nullif(CHARINDEX(' ',[agent name]),0),1000))) As FirstName,
Ltrim(SUBSTRING([agent name],CharIndex(' ',[agent name]),
Case When...
October 29, 2021 at 4:50 pm
The last name is always the 2nd spot and the first is always the first sport and the employee number is always the number after the dash.
October 29, 2021 at 3:49 pm
I have a different set of data on which I want to use PARSENAME:
Jamie Pourhussin (WTA) -692
Brenda Johnson -11337
Delia Rosenstiel -11256
Rodderick Douglas LD051121 -13224
Tynesha Townsend -14014
Mikala Fenner -12881
I can get...
October 29, 2021 at 3:30 pm
That works and teaches me the PARSENAME function better which I'm still trying to understand, but this is most helpful in getting me started to understanding it!
October 28, 2021 at 2:52 pm
Got it, putting debug clues in like PRINT @sql helps of course to see what the dynamic is creating:
declare
@ColumnNames nvarchar(max),
...
October 26, 2021 at 3:34 pm
Viewing 15 posts - 31 through 45 (of 388 total)