Viewing 15 posts - 7,396 through 7,410 (of 8,731 total)
I'm not sure if you're trying to add defaults to your report parameters or your SP parameters.
In case that you want defaults to your SP parameters, you have two options...
December 3, 2013 at 8:11 am
You could use an ESCAPE character.
DECLARE @Table1 TABLE
(
Column1 VARCHAR(32) NOT NULL PRIMARY KEY
);
INSERT @Table1(Column1)
VALUES
('abcdef123'),
('abcdef]123'),
('abcdef].123'),
('abcdef)123'),
...
December 2, 2013 at 10:18 am
Victor Kirkpatrick (12/2/2013)
December 2, 2013 at 6:41 am
Are you using reporting services or T-SQL code?
For T-SQL, you can use this formula:
DATEADD(hour, 7, DATEADD( Day, DATEDIFF(day, 0, GETDATE())-1,0))
November 28, 2013 at 9:36 am
Just to make it clear for someone else.
The underscore acts as a single character wildcard with the LIKE operator. To ensure you get an underscore, you need to put it...
November 28, 2013 at 9:24 am
What would happen with a value like 8.352?
November 28, 2013 at 9:04 am
Now the question is, do you understand how this works?
November 27, 2013 at 8:53 am
With piet's query you might loose rows if your dates have milliseconds after 13:49 and with dogramone's you might include dates on 13:50.
SELECT *
FROM #Test
WHERE myDatetime >= '2013-11-26 13:49'
AND myDatetime...
November 26, 2013 at 5:20 pm
That's because the column DTStamp is being implicitly converted to char with a different format.
Here are two options but might not be the best ones.
CREATE TABLE #Test( myDatetime datetime)
INSERT #Test...
November 26, 2013 at 5:16 pm
For a SQL DBA, you might want to look into becoming a Data Architech or follow a path to get more into administration and less into technology but that would...
November 26, 2013 at 1:27 pm
He's trying to count the events with Recordtype = 'promo' that have a corresponding event with Recordtype = 'event'. I don't know why, that's up to your needs.
The following might...
November 26, 2013 at 1:23 pm
Here's an example of a parametrized dynamic query using sp_executesql. Note that I'm using the DelimitedSplitN4K to split the values because you can't use IN for a single variable with...
November 26, 2013 at 11:23 am
You might want to change your @sql definition to something like the following:
set @sql = 'SELECT Company_NO,
'''' as CompanyName, --Added extra quote marks
CASE isNull(post_date, 0)
WHEN 0 THEN DATEPART(yyyy,...
November 26, 2013 at 11:10 am
Lowell (11/26/2013)
hunchback (11/26/2013)
WHERE ...
...
November 26, 2013 at 11:03 am
Here are 2 options to perform your calculation:
SELECT ABS(DATEPART( dayofyear, CutoffDate) - DATEPART( dayofyear, GETDATE())),
ABS(DATEDIFF( day, DATEADD( year, DATEDIFF( year, CutOffDate, GETDATE()), CutOffDate), GETDATE()))
FROM #Temp
November 26, 2013 at 10:46 am
Viewing 15 posts - 7,396 through 7,410 (of 8,731 total)