Viewing 15 posts - 2,806 through 2,820 (of 13,853 total)
Have you also considered FileTables for this?
March 27, 2020 at 3:31 pm
The fact that the result returned by
SELECT CAST('YYYY-MM-DD' AS date);
is language dependent, and therefore non-deterministic, is enough reason for me to use the 'YYYYMMDD' format, for which the above expression...
March 26, 2020 at 8:58 pm
If it were me, I think I'd resort to a script component, as there are too many nested IFs for my liking.
However, things could be made much easier on the...
March 26, 2020 at 8:35 pm
you can install OpenXML SDK and use that to create Excel Files without the need for Office to be installed.
But yes it does require coding in C# to...
March 25, 2020 at 7:43 pm
As far as I know (and I will happily be proved wrong), programmatic formatting of Excel sheets requires the installation of the Excel application. Without that, you do not have...
March 25, 2020 at 5:49 pm
Are you talking about this code? This doesn't work I get the same error.
DECLARE @DateStr NVARCHAR(50) = N'12172019';
SELECT @DateStr,
CAST(CONCAT(RIGHT(@DateStr, 4), LEFT(@DateStr, 2), SUBSTRING(@DateStr, 3, 2)) AS DATE);
For someone with...
March 24, 2020 at 8:05 pm

This is on 2017.
Can someone else please test on 2019? Or maybe explain why it would not work there?
March 24, 2020 at 4:20 pm
I think what you really want is DATETIMEFROMPARTS()
I started out down this path, but found that carving out all of the individual components resulted in an even longer...
March 24, 2020 at 4:16 pm
I have searched, and none of the solutions have worked. otherwise I wouldn't have posed my issue.
Are you saying that my code 'does not work'? If so, please provide...
March 24, 2020 at 1:51 pm
I'm sure that this could be simplified with a bit more thought, but this works for the example provided:
DECLARE @Text NVARCHAR(250) = N'CTranTyp-ViewId_2020.03.24_13h05min10s.xls';
SELECT
...
March 24, 2020 at 1:48 pm
it is defined as [Due Date] (nvarchar(10),null)
OK, so my code should work, with some refinements to handle the zeros.
March 23, 2020 at 10:06 pm
DECLARE @DateStr NVARCHAR(50) = N'12172019';
SELECT @DateStr,
CAST(CONCAT(RIGHT(@DateStr, 4), LEFT(@DateStr, 2), SUBSTRING(@DateStr, 3, 2)) AS DATE);
March 23, 2020 at 9:18 pm
"Not working" is not helpful. What is the error message?
NVARCHAR needs a length.
What is the data type of [due date]? If it's a date, why not just
CAST([due date]...
March 23, 2020 at 9:10 pm
"Not working" is not helpful. What is the error message?
NVARCHAR needs a length.
What is the data type of [due date]? If it's a date, why not just
CAST([due date] as DATE)
?
March 23, 2020 at 9:07 pm
Viewing 15 posts - 2,806 through 2,820 (of 13,853 total)