Viewing 15 posts - 316 through 330 (of 842 total)
If I know for sure the date field does NOT carry any time values then I agree with using the between. But if it has time, you could miss records. ...
October 2, 2018 at 1:17 pm
Jeff Moden - Monday, October 1, 2018 9:02 AMExactly.
I can see your points. But as with many things in SQL I...
October 2, 2018 at 12:50 pm
Just added a few tweaks:DECLARE @StartDate DATE;
DECLARE @EndDate DATE;
DECLARE @PrevYearStart DATE;
DECLARE @PrevYTDEnd DATE;
DECLARE @MonthStart DATE;
SET @StartDate = '01-01-2018';
SET @EndDate =...
October 2, 2018 at 12:33 pm
Looks like you got the YTD numbers. Use the DATEADD to determine your Previous year start and end dates, same for month to date.
Start by writing these as...
October 2, 2018 at 10:36 am
You have a comma after Facility, that is what is casing the error.
October 2, 2018 at 7:30 am
October 2, 2018 at 7:28 am
October 1, 2018 at 8:28 am
October 1, 2018 at 8:18 am
If you are running a DELETE SQL statement you could use the OUTPUT statement to write the rows deleted to another table.
https://msdn.microsoft.com/en-us/library/ms177564.aspx
October 1, 2018 at 8:01 am
What part is taking the most time? Can you split it up to see?
Try replacing the first SQL with something like this:
SET @prep_date_start = COALESCE(@prep_date_start,...
September 28, 2018 at 9:59 am
September 27, 2018 at 9:46 am
September 26, 2018 at 7:56 am
ManicStar - Monday, September 24, 2018 12:05 PMCheddar
Provolone
September 24, 2018 at 1:51 pm
September 24, 2018 at 8:22 am
You could try this:
CONVERT(CHAR(11), DateIn, 107) AS DateIn
September 21, 2018 at 7:50 am
Viewing 15 posts - 316 through 330 (of 842 total)