Viewing 15 posts - 3,811 through 3,825 (of 4,087 total)
Given the data points for the date, it looks like the base date is 1899-12-30. The time is harder to determine, because you haven't given us enough data points....
November 17, 2010 at 3:14 pm
I also notice that you are missing some indices that might help. For example, Oilchange_Notes is missing an index on vehicle_id. Since that is used in your join,...
November 3, 2010 at 3:18 pm
GilaMonster (10/29/2010)
DECLARE @date1 DATETIME
DECLARE @date2 DATETIME
SET @date1 = DATEADD(mi, 120, DATEADD(dd,0,DATEDIFF(dd,0,GETDATE())-1)) -- yesterday at 2:00 am
SET @date2 = DATEADD(mi,60,@date1)
I'm curious about why you used minutes rather than hours for the...
October 29, 2010 at 4:39 pm
BenWard (10/28/2010)
thats brilliant thanks.I'm surprised there isnt an alternative version of count in sql server that returns the number of rows like a numrows() function or whatever.
Thanks
You mean like Count(DISTINCT...
October 28, 2010 at 8:16 am
It uses the "quirky update". Jeff Moden wrote an article about the quirky update.
Drew
October 27, 2010 at 2:28 pm
My issue with defining it as multiple tables is that you lose the fact that the order is important when you start introducing outer joins. Consider the following example:
WITH...
October 26, 2010 at 12:45 pm
Actually, this is like Wave/Particle duality. In some situations, it helps to think of the joins working on multiple tables, but in other situations it helps to think of...
October 26, 2010 at 9:19 am
Craig Farrell (10/25/2010)
Okay, the error message is simple enough, but I thought the point of EXCEPT was to reword the anti semi-join operation?
The purpose of EXCEPT is to handle set...
October 26, 2010 at 6:40 am
You may also need to use dynamic SQL. It's really difficult to tell without DDL, sample data, and expected results to work with.
Drew
October 21, 2010 at 3:00 pm
Depending on the complexity of your query, you could try FOR XML AUTO, ELEMENTS or FOR XML PATH('some value') instead of XML EXPLICIT.
Drew
October 21, 2010 at 2:53 pm
Your data is missing the decimal point whose sole purpose is to indicate which part is the integer portion and which part is the decimal portion. By convention, the...
October 21, 2010 at 12:11 pm
This sounds suspiciously like a homework assignment. The answer to this question is easily found with a little research. The fact that you didn't find it suggests that...
October 21, 2010 at 11:15 am
Your row number is only partitioned by the Systalk_ID, but the grouping in the outer query is based on Systalk_ID, Attendance_Type, and SC_Attendance_ID. You want these to match.
Drew
October 21, 2010 at 10:39 am
This should get you close to what you are looking for. Essentially it takes the intersection (A) of two sets (B) and (C) and adds the values to the...
October 21, 2010 at 10:27 am
Iulian -207023 (10/21/2010)
What about storing data as int like this yyyymmdd? (year*10000 + month*100 + day)
There is a perfectly good datatype that is optimized for working with datetime data. ...
October 21, 2010 at 6:38 am
Viewing 15 posts - 3,811 through 3,825 (of 4,087 total)