Viewing 15 posts - 1,561 through 1,575 (of 2,007 total)
The tally table is fine, it gives dates between 1900-01-01 and 7361-04-01 so you're unlikely to have hit the ceiling there 😛
Try this: -
--First, lets build some test data
DECLARE @TABLE...
August 31, 2011 at 7:15 am
How about this?
(I've used SQL Server 2008 syntax, since that's the forum you posted in)
CREATE FUNCTION [dbo].[Batchseriesdate] (@batchseriesno VARCHAR(16))
RETURNS DATE
AS
BEGIN
DECLARE @cleardate DATE
...
August 31, 2011 at 6:41 am
greg.bull (8/31/2011)
August 31, 2011 at 4:48 am
greg.bull (8/31/2011)
Month 4 would have metric2 as 9 - cos it would be 4+3+2.
Month 5 would have metric2 as 12 (5+4+3).
The problem would be that (and this is my...
August 31, 2011 at 4:10 am
ChrisM@Work (8/31/2011)
DROP TABLE #Sample
CREATE TABLE #Sample (Yearmonth DATE, Metric1 INT, Metric2 INT)
INSERT INTO #Sample (Yearmonth,...
August 31, 2011 at 3:51 am
How's this?
--First, lets build some test data
DECLARE @TABLE AS TABLE (Yearmonth DATETIME, Metric1 INT, Metric2 INT)
INSERT INTO @TABLE (Yearmonth, Metric1)
SELECT '2010/01/01', 1 UNION ALL
SELECT '2010/02/01', 2 UNION ALL
SELECT...
August 31, 2011 at 3:44 am
I've interpreted the problem differently to Gianluca, so there's a good chance that this doesn't do what you want, but feel free to check 🙂
DECLARE @UserDate datetime
SET @UserDate = '20110810'
DECLARE...
August 31, 2011 at 2:10 am
Thanks for the sample data 🙂
Not sure what version of SQL Server you're using.
Try this (2005+ only)
SELECT EmdId, EmpName, DeptName, MAX(rn) AS NumberofDependents
FROM (SELECT e.EmdId, e.EmpFName + ' '...
August 30, 2011 at 9:37 am
Certainly!
First though, please read this[/url] for information on how best to post a question that will get your question answered quickly.
Thanks
August 30, 2011 at 8:31 am
peanuts91 (8/30/2011)
Thanks Gianluca.But If I have a field containing for example 'Abraham', it will detect the A appears 3 times. But not 3 times in a row like aaa.
How's this?
DECLARE...
August 30, 2011 at 8:25 am
Done some perf-tuning, requires a bit more but ran out of time for today.
On my box
Performed against the following "Givens" -
' 15 ...
August 24, 2011 at 7:40 am
In SSRS, format the datetime column like this : -
=Format(Parameters!DATETIMECOLUMN.Value,"dd/MM/yyyy")
August 24, 2011 at 4:38 am
Funny this came up just after this discussion 🙂
August 24, 2011 at 3:44 am
Didn't have time for perf-tuning last night, but this morning I quickly knocked up a conversion between the table from the SQL Challenge to a string so the rest of...
August 24, 2011 at 3:10 am
SQLRNNR (8/23/2011)
August 23, 2011 at 8:25 am
Viewing 15 posts - 1,561 through 1,575 (of 2,007 total)