Forum Replies Created

Viewing 15 posts - 6,796 through 6,810 (of 8,731 total)

  • RE: Converting Time to Decimal

    You're welcome.

    It might look simple, but I want to be sure that you understand how does it work. Do you have any questions?

  • RE: Date Conversion Problems Using BIDS

    I created a file that includes exactly this:

    "2/27/2014 13:30"

    My test connection has Text qualifier: "

    And it previes like this:

    2/27/2014 13:30

    I added the Derived Column with the following expression:

    (DT_DBTIME)DateTest

    And inserted into...

  • RE: Date Conversion Problems Using BIDS

    What's the data type for the column on the connection?

  • RE: SQL Date

    Maybe some calculations like this?

    DECLARE @Datedatetime = '2014-02-25' --Test with any date

    SELECT @Date,

    CASE WHEN DAY(@Date) > 26 THEN DATEADD( DD, 26 - DAY(@Date), DATEADD( DD, DATEDIFF( DD, 0, @Date), 0))

    ELSE...

  • RE: Converting Time to Decimal

    I'm giving you 2 solutions depending on the format you want.

    WITH SampleData (PERSON, [DATE], [MINUTE]) AS

    (

    SELECT 1125,'27/01/2014',70

    UNION ALL SELECT 1125,'27/01/2014',3

    ...

  • RE: List of Values to Stored Procedure

    JohnFTamburo (2/27/2014)


    This approach opens up systems to SQL injection attacks if the database is utilized by any interactive programming.

    Can you explaing how is this vulnerable to SQL Injection? It...

  • RE: List of Values to Stored Procedure

    A Table Valued Parameter could be a good option. If you have your @p_ItemID as several items separated by commas (or another delimiter) you could use a splitter as well....

  • RE: Would Bulk Insert Help??

    Bulk insert is to insert values from a file.

    You need to identify if the problem is the source or the destination. How long does it take the query to execute?...

  • RE: Management Studio Intellisense not working

    Are you connecting to a 2008 server? I don't remember if it'll work with a 2005 server but with 2000 it won't.

  • RE: Help convert int to varchar function

    MyDoggieJessie (2/27/2014)


    You could create a simple scalar function and call that as needed (or take the code from this to use as well)

    No, don't do that. Scalar functions are...

  • RE: Hours Calculation

    How would you calculate hours for Mr. Patrick Liw? You only have one row for him. You can't calculate the time, you could give an arbitrary value using LEFT JOIN...

  • RE: ProperCase Function

    Sean Lange (2/27/2014)


    dwain.c (2/26/2014)


    Sean Lange (2/26/2014)


    I made a slight modification to Dwain's that worked well for my purposes.

    Can't say I see that much of a resemblance but it is always...

  • RE: How To Sort By the MAX value in one cal

    Are you looking for something like this?

    ORDER BY MAX(DateUsed) OVER(PARTITION BY ObjectName, UserName)

  • RE: Invalid Cursor Position - No Cursor in Use...

    I'm not sure if it will help but it makes me wonder. Why are you using SELECT...INTO instead of INSERT INTO? That might be part of the problem.

  • RE: DateDiff() function reported as NonDeterministic

    You need to do an explicit CONVERT to use the string literal.

    I changed your code a little bit to remove the +1

    CREATE TABLE Test(

    DayDate DATE,

    DayNumber AS (DATEDIFF( DD, CONVERT( DATE,...

Viewing 15 posts - 6,796 through 6,810 (of 8,731 total)