Viewing 15 posts - 736 through 750 (of 13,838 total)
Try this:
(DT_DATE)(DT_DBDATE)DATEADD("m", -25, DATEADD("d", -DAY(GETDATE()) + 1, GETDATE()))
November 2, 2023 at 4:25 pm
What do you mean by 'track', exactly? Insert details of change to an audit table? Use SQL Server's 'Change Tracking'? Send an e-mail alert? Something else?
November 2, 2023 at 4:07 pm
I suggest you create a query which includes a TRY_CAST to INT of the column of interest.
Use your existing WHERE clause, but add another condition
AND TRY_CAST(Col as INT) IS NULL
This...
November 2, 2023 at 3:18 pm
But its an Implicit conversion, wouldn't it be better to explicitly convert the value to Varchar.
Usually, I'd agree with you on explicit vs implicit conversions. But here is a...
November 2, 2023 at 10:50 am
BUT, that will only work if LEN(ValueID) <= 12 For longer strings, you will need to break ValueId into parts to match the GUID pattern
The value is actually...
November 2, 2023 at 10:25 am
The query I provided returns the result you requested. Why do you think that it is not correct?
November 2, 2023 at 9:16 am
You have a VARCHAR column containing string data. Some of the data can be converted to an INT and some cannot. What do you want to see in the cases...
November 2, 2023 at 9:13 am
Try this, noting that
a) Varchars should always be declared with an explicit length
b) When inserting literal varchars, surround them with single quotes
DROP TABLE IF EXISTS #test;
CREATE TABLE...
November 2, 2023 at 9:03 am
Based on this logic
If the memberid is active can be determined by not having any 'Cancelled' transtype
This is the code I would use
SELECT DISTINCT tm.grouingnum
FROM #testMember tm
WHERE...
November 1, 2023 at 8:55 pm
Is there any chance that you can provide some sample data (in the usual CREATE TABLE / INSERT form) and simply tell us what you would like to see as...
November 1, 2023 at 3:11 pm
Also, I could be mistaken, but I am fairly confident that SQL Express handles up to 10 GB Databases, not 1 GB... and quick google confirmed this: https://learn.microsoft.com/en-us/sql/sql-server/editions-and-components-of-sql-server-2019?view=sql-server-ver16
I had...
October 26, 2023 at 2:38 pm
I suggest that you do a check on the current datatype of the column and execute the ALTER only where the datatype is not an INT. Here is some sample...
October 25, 2023 at 1:29 pm
i think it is wrong
this query below must return LDM
BECAUSE employee no 407133 exist on two columns rean83 and rean84
Ah, you mean the SAME employee number ... not just...
October 21, 2023 at 4:47 pm
Your image is inconsistent. For example
RequestNo 12002 and RequestNo 12011 both have three NON NULL REAN columns, yet you have given them different roles.
Here is the solution, based on your...
October 21, 2023 at 1:27 pm
Why not create an SSISDB? Takes just a few minutes. Deploy the packages there and you get a whole load of error logging 'for free', which might help you diagnose...
October 20, 2023 at 8:45 pm
Viewing 15 posts - 736 through 750 (of 13,838 total)