Forum Replies Created

Viewing 15 posts - 646 through 660 (of 897 total)

  • RE: Where i am making mistake..?

    Such mistakes happen sometimes. So no problems. Glad i could help you out 🙂

  • RE: Where i am making mistake..?

    You probably forgot a JOIN condition on the Price Column

    SELECT[ResultID], [HotelSearchResults].[HotelID], [HotelName], P.minPrice

    FROM[Hotels].[dbo].[HotelSearchResults]

    INNER JOIN(

    SELECTHotelID, MIN(Price) AS minPrice

    FROMHotelSearchResults

    GROUP BY HotelID

    ) P

    ON HotelSearchResults.HotelID = p.HotelID

    AND HotelSearchResults.Price = P.minPrice -- You missed this...

  • RE: Order by is to slow in a query

    Check the Actual Execution Plan to see if the ORDER BY is the real problem. Most probably it might be but its always better to confirm.

    If its confirmed that the...

  • RE: Datetime convertion

    Gianluca Sartori (10/29/2010)


    Try this:

    SELECT CAST(DATEPART(hh,timer) AS FLOAT) + (CAST(DATEPART(mi,timer) AS FLOAT)/60)

    FROM tblTimeRecorder

    BTW, get rid of that "tbl" prefix on your tables before Joe Celko catches you...

    :-D:-P:-D He has managed...

  • RE: Datetime convertion

    eroness (10/29/2010)


    Sorry, it return only whole number (I think it's Integer).

    The Datepart function for the minutes should return 0,5 but return 0.

    SELECT skjema_nr, skjema_arb_lengde, DATEPART(mi, skjema_arb_lengde) / 60 AS Expr1

    FROM...

  • RE: 100 Years Ago, What Would You Be?

    If i had the education i have today, I would probably be a teacher. I would love to teach Mathematics or English or Hindi( Its the official language in India,...

  • RE: Row presented as column and vice versa

    You can use either PIVOT or CROSS TABS. CROSS TABS according to me are easier to understand.

    The links below contain good articles on the same

    http://www.sqlservercentral.com/articles/T-SQL/63681/

    http://www.sqlservercentral.com/articles/Crosstab/65048/

  • RE: Convert Varchar to Datetime

    Iulian -207023 (10/21/2010)


    Things might change if I need to transfer the data from/to another system, non SQL Server, for example using CSV file, this yyyymmdd might be useful in this...

  • RE: Convert Varchar to Datetime

    Iulian -207023 (10/21/2010)


    What about storing data as int like this yyyymmdd? (year*10000 + month*100 + day)

    The pros are:

    the numerical order is the same...

  • RE: Convert Varchar to Datetime

    Glad that i could help you. Now see if you can convert that column to DATETIME or a SMALLDATETIME datatype to avoid such problems in the future. It is not...

  • RE: How Truncate statement ?

    Good Question. One more point can be added to the answer.

    You can truncate a table that has a foreign key that references itself

    See the link to the BOL...

  • RE: Convert Varchar to Datetime

    OK. Now try the below queries and see if you get any data in incorrect format

    SELECT *

    FROM tbl_00001

    WHERE SUBSTRING( uploadtime, CHARINDEX(...

  • RE: Convert Varchar to Datetime

    Did you try the below query in the client's place

    SELECT * FROM tbl_00001 WHERE ISDATE(uploadtime) = 0

    If YES. What was the data you got from the query?

  • RE: Convert Varchar to Datetime

    kirubamca09 (10/20/2010)


    Hi sharath.chalamgari

    pls did you find any solution let me know.

    Your error message clearly says that there is some data in your clients side which...

  • RE: Convert Varchar to Datetime

    What is the error message your client is getting?

    Probably your client has some data which is not in dd/mm/yyyy hh:mm:ss AM/PM format.

Viewing 15 posts - 646 through 660 (of 897 total)