Viewing 15 posts - 1 through 15 (of 541 total)
I completely missed the different years - so change the where clause to:
WHERE Balance > 0
OR (last_modified_date >= '20210401' AND last_modified_date < '20220401')
So if the item...
April 12, 2022 at 8:46 pm
How about:
SELECT A , B , C ...
From Table_A
WHERE ( last_modified_date between '01/04/2021 00:00:00' and '31/03/2022 23:59:59' )
OR ( balance > 0 and last_modified_date ...
April 12, 2022 at 11:40 am
If you want to exclude, simply reverse your conditions. For example, rather than "IN" use "NOT IN" or instead of "<" use ">=". Or, alternately, toss some brackets around...
December 23, 2021 at 9:28 pm
Actually I want to exclude rows in the dataset not include based on the condition.
December 23, 2021 at 7:37 pm
Hi,
Thanks for your reply.
just as a general query, could you please help on how to exclude rows in sql if there are multiple conditions involved.
I will try to build up...
December 23, 2021 at 4:45 pm
Can they select multiple offices or fol_num's? If so, then it gets a lot more challenging, but if not, then it should be something like this:
AND...
November 26, 2021 at 5:30 pm
Sounds like homework to me...
AS PP said, no code without DDL and populated tables... but here is my approach:
Q1: CTE to filter cases to 2010H2, CTE to apply RANK()...
April 26, 2020 at 9:45 am
This sounds like a homework assignment...
Question 1 is pretty trivial as you are just using datediff on the Cases table with a WHERE to put the date greater than...
April 26, 2020 at 9:44 am
Thanks for your kind help. Will try to proceed now.
April 26, 2020 at 9:43 am
Thanks, I have tried using Throw as you suggested buts its still showing the same error comment without mentioning the exact stored procedure which is giving the error
March 26, 2020 at 1:06 pm
type sample data
Please find the DDL and sample data below.
the requirement is to display the product_ID for the row where the values have changed for the following 5 columns:
Main_Product
Product_Colour
Product_Size
Tax_Class_ID
Outer_Print_Name
Thanks...
March 13, 2020 at 12:06 pm
binary_checksum() ?
Thanks but I need to display the IDs for all the rows for which the values have changed for 4 columns.
March 13, 2020 at 11:29 am
DECLARE
@String VARCHAR(100) = 'CKflower2002-pouch-5AR-OneSize'
select
SUBSTRING(@string,PATINDEX('%[0-9]%',@string),PATINDEX('%[^0-9a-z]%',@string)-PATINDEX('%[0-9]%',@string))
That will work for whatever the first delimiter is and for any length of string before the numbers. It...
March 10, 2020 at 1:15 pm
DECLARE
@String VARCHAR(100) = 'CKflower2002-pouch-5AR-OneSize'
select
SUBSTRING(@string,PATINDEX('%[0-9]%',@string),PATINDEX('%[^0-9a-z]%',@string)-PATINDEX('%[0-9]%',@string))
That will work for whatever the first delimiter is and for any length of string before the numbers. It does assume...
March 10, 2020 at 12:44 pm
select REPLACE(REPLACE(SUBSTRING('CKnovelty2002_pouch-5AR-OneSize',1,CHARINDEX('_','CKnovelty2002_pouch-5AR-OneSize',1) - 1),'CKnovelty',''),'CKflower','')Your CHARINDEX was looking for '-' rather than '_'.
Hi Neil,
Many thanks for your kind response and it would work well in certain situations....
March 10, 2020 at 11:42 am
Viewing 15 posts - 1 through 15 (of 541 total)