Viewing 15 posts - 9,556 through 9,570 (of 10,144 total)
Not sure you need to do that. First thing I'd do is check the joins. You've got TT_StaffingPlan INNER JOIN TT_Users
but
TT_EntryLog RIGHT OUTER JOIN TT_Users
You need to find out...
September 19, 2008 at 8:27 am
Madhivanan (9/19/2008)
The proper way would begroup by dateadd(day,datediff(Day,0,date_col),0)
For group by, it doesn't necessarily need to be cast back to a datetime:
datediff(Day,0,date_col)
September 19, 2008 at 8:13 am
Hi Beruken
Instead of counting how many rows each of the temp tables contains and using the result to determine which is the parent table, it would make sense to use...
September 19, 2008 at 7:53 am
steveb (9/19/2008)
Terri (9/19/2008)
You do want to count them, but you want to cancel them out. Otherwise the replace function will catch them and it will ruin the count.
Why...
September 19, 2008 at 7:38 am
For better, quicker answers, click on the following... http://www.sqlservercentral.com/articles/Best+Practices/61537/ (Thanks Jeff)
You could CAST the [ID] as a varchar.
September 19, 2008 at 5:40 am
ALZDBA (9/19/2008)
There is this very nice and eye-opening article concering ranges ...Called "The "Numbers" or "Tally" Table: What it is and how it replaces a loop."
Nobody listens on a friday...
September 19, 2008 at 5:02 am
Or use a Tally table:
[font="Courier New"]SET DATEFORMAT YMD
SET DATEFIRST 1 -- monday, so sunday is 7
DECLARE @StartDate DATETIME, @EndDate DATETIME
SET @StartDate = '2008-09-01' -- implicit conversion
SET @EndDate = '2008-09-22' --...
September 19, 2008 at 5:00 am
[font="Courier New"]DECLARE @MyDate DATETIME
SET @MyDate = CAST('2008-09-19' AS DATETIME) -- makes a date without a time component
SET @MyDate = DATEADD(dd,DATEDIFF(dd, 0, GETDATE()), 0) -- chop the time component off today
SELECT...
September 19, 2008 at 3:27 am
Is there any reason why you aren't using a start date (the first day of week 36) and an end date (the last day of week 39) for this?
WHERE YourDateColumn...
September 19, 2008 at 3:09 am
Nomvula (9/18/2008)
September 18, 2008 at 2:00 am
Nomvula (9/17/2008)
for instance '01/09/2008' - '07/09/2008' by looking in my calendar those dates fall in week 36 so i need to get all the dates which falls on wk 36,37,38,39
Here's...
September 17, 2008 at 7:57 am
Nomvula (9/17/2008)
hi Christhanks for the response, actualy i'm trying to get dates within week 36,37,38,39.
apologies for my mistake, i didn't elaborate that thorough
Which dates, Nomvula? The start and end dates...
September 17, 2008 at 5:45 am
Nomvula (9/17/2008)
hi guysi need to create a script to get week 36,37,38 and 39 of the current year.
No problem:
SELECT DATEPART(YY, GETDATE()) AS CurrentYear, CAST(36 AS SMALLINT) AS [Week] UNION ALL
SELECT...
September 17, 2008 at 5:29 am
Hi Sanjay
Please have a read of this thread: http://www.sqlservercentral.com/Forums/Topic565091-145-1.aspx
it will help us to help you.
Cheers
ChrisM
September 17, 2008 at 5:20 am
So, some of the time you take the maximum value of the overlaps, and other times you take the sum of the overlaps. What's the logic for the decision?
September 16, 2008 at 12:53 am
Viewing 15 posts - 9,556 through 9,570 (of 10,144 total)