Forum Replies Created

Viewing 9 posts - 2,161 through 2,169 (of 2,169 total)

  • RE: GEOCODE Street corner --- brain stopped

    It is very easy to build!

    Suppose you have all coordinates in a table name 'Streets'. This table has a field named 'StreetName', a field named 'x' and a...

  • RE: need help in aging query (Date difference problem)

    How are dates related to table structure?

    Just help the guy!

    Sale in Last Year?

    Does that mean previous full year or current running last year?

    DECLARE @WorkDate DATETIME, @StartDate DATETIME, @EndDate...

  • RE: Find a second record

    Andy, here is your code!

    ------------------------------------------------------------

    SELECT    Customers.CustomerID,

              Customers.CustomerName,

              LO.LastOrderDate,

              (SELECT MAX(Orders.OrderDate) FROM Orders WHERE Orders.OrderDate < LO.LastOrderDate AND Orders.CustomerID = Customers.CustomerID) PreviousOrderDate

    FROM      Customers

    LEFT JOIN (

             ...

  • RE: Querying Dates

    If is really is a "start date", just use

    WHERE start_date >= '11/05/2006'

    If you just want the explicit date 11/05/2006, use

    WHERE CONVERT(VARCHAR(10), start_date, 101) = '11/05/2006'

     

  • RE: identity column

    I think this is because SMALLINT can only handle number between -32786 and 32767, inclusive.

    INT can handle numbers between -2147483648 and 2147483647, inclusive.

    Check your tables to see if you have...

  • RE: Reverse Recursion problem - suggestions please ;-)

    declare @string varchar(50)

    select @string = '1-29-48-72'

    ----------------------- real code here

    declare @index int, @s-2 varchar(50)

    select @s-2 = @string, @index=1

    while @index > 0

    begin

     print...

  • RE: Pivot Table Generator Code

    That seems to work! But only for SQL 2005, sadly enough.

    We still have 1 SQL 6.5, 4 SQL 7.0 and 13 SQL 2000, so this is what I come up with to...

  • RE: Pivot Table Generator Code

    Yes. If you know which columns you want.

    No. Since you have to hardwire the column names for the PIVOT operator in SQL 2005.

    With my code you don't have to.

  • RE: How to find out the identity coloumn of a table.

    SELECT identitycol FROM WhatEverTable WHERE 1 = 0

Viewing 9 posts - 2,161 through 2,169 (of 2,169 total)