Viewing 15 posts - 346 through 360 (of 7,608 total)
SELECT
SUM(CASE WHEN HowManyDays <= 30 THEN thisAmt ELSE 0 END) AS aging_0_30,
SUM(CASE WHEN HowManyDays >= 31 AND HowManyDays <=...
October 3, 2023 at 8:27 pm
(1) Use differentials rather than full backups for most backups. For example, daily diffs and only, say, weekly full backups.
(2) If you're not already using backup compression, and particularly if...
October 3, 2023 at 2:22 pm
The value needs to be a string:
STRING_SPLIT('1008,1009,1011,1014',',')
October 2, 2023 at 4:13 pm
A NULL value should not cause an error, ASCII(NULL) should just return NULL.
October 1, 2023 at 4:05 pm
How do you define "week number"? Are the first 7 days of the month "week 1", or is it based on specific day of the week? For example, all weeks...
September 27, 2023 at 8:22 pm
Increase the size of your tempdb files.
September 27, 2023 at 8:20 pm
Inside that same db, run this command:
EXEC sys.sp_help tblstudent
or this:
SELECT * FROM sys.columns WHERE name = 'tblstudent'
Either of those should give you info about the table to compare to the...
September 25, 2023 at 6:04 pm
"tblstudent" already exists -- with a different number of columns -- so the create table statement is failing, but the insert still tries to execute.
September 25, 2023 at 5:37 pm
3409177 rows, of course only way we query is using logid ,
If, as you say, you are querying by a single, unique PK value, the lookup should be quick...
September 24, 2023 at 2:51 am
I'll take a look at it a bit later today.
September 19, 2023 at 3:03 pm
You're welcome. Yeah, OUTER APPLY is pretty useful, like here when you kinda want a join but only want 1 row, not all of them.
September 18, 2023 at 7:56 pm
;WITH CTE_ADMITS AS (
SELECT A.*, ISNULL(LEAD(A.DISCHARGE_DATE, 1) OVER(PARTITION BY ID_NUM ORDER BY DISCHARGE_DATE), '20790601') AS NEXT_DISCHARGE
FROM ADMITS A
)
SELECT A.*,...
September 18, 2023 at 6:38 pm
IF the MMDDYYYY formatted string date is guaranteed to always be 8 characters, the following works (most of the posted code doesn't consider the inclusion of the ".txt") according...
September 15, 2023 at 3:15 pm
I wasn't 100% sure if 101 and 102 could appear more than once in the risk table, so I coded it to allow that, just in case.
If each can appear...
September 14, 2023 at 8:57 pm
What result do you want? You never explicitly stated the results you want to see.
September 14, 2023 at 6:21 pm
Viewing 15 posts - 346 through 360 (of 7,608 total)