Forum Replies Created

Viewing 15 posts - 2,026 through 2,040 (of 2,171 total)

  • RE: Converting varchar to datetime in select statement

    Yes, the SQL Server can't interpret those days show, as valid dates for various reasons.

    One reason can be that the date format has changed, for example from d-m-y to m-d-y...

  • RE: Stored Procedures and Arrays

    You're welcome! Now there is only holidays to take care of as well

    Actually, there are so many ways to utilize functions, like...

  • RE: Nested/Hierarchical table query

    Thank you.

    There is one drawback with my method. You can only have 2,000 levels of nodes. But you can have 2 billion nodes in total!

    For the CSV method, the output...

  • RE: Stored Procedures and Arrays

    Of course you will experience a time-out! Your variable @cnt in the function never increments and thus will WHILE loop never exit. Please use a proper...

  • RE: Converting varchar to datetime in select statement

    I think one row or more in the Admissions_data table contains an invalid date. This is the most likely scenario.

    Which is the fourth column of date information? Is this column...

  • RE: Stored Procedures and Arrays

    If you do not want the versatility of my function fnSeqDates, this is a rewrite only of your VBA script.

    CREATE FUNCTION dbo.fnWorkingDays

    (

     @msDate1 DATETIME,

     @msDate2 DATETIME

    )

    RETURNS INT

    AS

    BEGIN

     DECLARE @Days INT

    June 28, 2006 at 3:48 am

    #646318

  • RE: Converting varchar to datetime in select statement

    You are using ODBC to copy from one table in SQL to another table in SQL?

    Create a stored procedure to do that for you, and call the SP from your...

  • RE: Converting varchar to datetime in select statement

    I think we are missing some information here. It seems that the ODBC driver does not recognize the datetime format.

    What are you trying to accomplish? Inserting rows from an outside...

  • RE: Converting varchar to datetime in select statement

    If necessary, use

    INSERT DestinationTable (DestField)

    SELECT CONVERT(DATETIME, MyField, 121) FROM SourceTable

    121 is not needed. It is just there for enforcing yyyy-mm-dd hh:mm:ss.mmm format. SQL Server tries to...

  • RE: Stored Procedures and Arrays

    Use a function like this, or any other similar. Call with

    SELECT COUNT(*) Workdays FROM dbo.fnSeqDates('8/1/2006', '8/31/2006') WHERE DATEPART(dw, SeqDate) BETWEEN 2 AND 6

    or

    SELECT SeqDate Dates FROM dbo.fnSeqDates('8/31/2006', '8/1/2006') WHERE...

  • RE: Display of date format in Japanese machine.

    See Regional Settings in Control Panel.

  • RE: Converting Integer to Date

    ???

    SQL Server has a start date of January 1, 1753 and end date of December 31, 9999 when using DATETIME. SMALLDATETIME has start date of January 1, 1900 and end date of June...

  • RE: Excel - SQL Server 2000

    Microsoft Excel, prior to version 2007, does not support 500 columns. Max is 256 columns for older versions and 1024 columns for Excel 2007.

  • RE: Connection Failed SQLState: ''''01000''''

    We are not able to see images stored on your local computer at drive m:

    Please upload image to public website and post the link here to that image.

     

    Meanwhile, try to open...

  • RE: Nested/Hierarchical table query

    Try these functions!

    CREATE FUNCTION dbo.fnGetTree-- returns csv

    (

     @ParentID INT,

     @Levels INT

    )

    RETURNS VARCHAR(8000)

    AS

     BEGIN

      IF @Levels < 1

       RETURN ''

      DECLARE  @Tree TABLE

        (

         TreeID INT IDENTITY(0, 1),

         TreeKey VARBINARY(8000),

         Generation SMALLINT,

         ParentID INT,

         ID INT

         )

    June 28, 2006 at 1:01 am

    #646285

Viewing 15 posts - 2,026 through 2,040 (of 2,171 total)