Forum Replies Created

Viewing 15 posts - 3,811 through 3,825 (of 4,087 total)

  • RE: Datetimme Stamp

    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....

  • RE: Query with Performance Issues

    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,...

  • RE: select a record based on a time range

    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...

  • RE: using group by and count together.

    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...

  • RE: How does my concatenation UDF work?

    It uses the "quirky update". Jeff Moden wrote an article about the quirky update.

    Drew

  • RE: Really Simple - "Join" clarification

    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...

  • RE: Really Simple - "Join" clarification

    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...

  • RE: EXCEPT usage

    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...

  • RE: Dynamically generate node names

    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

  • RE: Dynamically generate node names

    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

  • RE: Converting Varchar colum to Money in SQlserver2005

    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...

  • RE: Dynamically generate node names

    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...

  • RE: using Partition to creat a matrix. IDs not going into column 1

    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

  • RE: Bundle/Group data elements linked in M-M table

    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...

  • RE: Convert Varchar to Datetime

    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. ...

Viewing 15 posts - 3,811 through 3,825 (of 4,087 total)