Forum Replies Created

Viewing 15 posts - 16 through 30 (of 57 total)

  • RE: Need help with max value in date column

    No, I've answered two questions since then, I deleted it. I do think I looked through the correct numbers being there, and thus pursued the wrong solution, after reading...

  • RE: Exercise Q from 70-461 Training Book

    SELECT CreditCardID,

    right('00000000000' + cast (CreditCardID as varchar(10)), 10)

    AS ProductionIDColumn

    FROM Sales.CreditCard

    I just grabbed a random AdventureWorks table to use.

    I cast the number to a string, add 10 zeros to the...

  • RE: insert (xml dml) error

    The example is obviously broken. I wonder what the use of inserting a CDATA section in to XML, in SQL is, any how ?

  • RE: Need help with max value in date column

    Damn - you're right. I did that, without the row number, and didn't think the right values came out, that's why I started looking at group by.

    To the OP...

  • RE: Need help with max value in date column

    True - the real question is, does his calculated column come from a single row, or is it an aggregate ? I couldn't find any combination that gave the values...

  • RE: Need help with max value in date column

    Great. If I'm not, you need to explain where you want those numbers to come from, what they are calculating, and we can try again 🙂

  • RE: Need help with max value in date column

    select employee_id,date_joined ,max(date_) as maxDate, sum(ROUND((sal+due_amount),2))

    from employee

    group by employee_id, date_joined

    I cannot work out where 8.6 and 4.64 are supposed to come from. If I knew that, I would know...

  • RE: Begginer in SQL Procedures

    There is much wrong here, starting with the idea of having one proc do three things based on a 'magic number'. I suggest breaking this in to three procs,...

  • RE: T-SQL Help

    When you want to merge different counts, create them in CTEs and them join them together:

    DECLARE @date datetime = '10/21/2013'

    ;WITH opened

    AS(

    SELECT [group], count(1) as [count] FROM #TempTable WHERE createDate...

  • RE: t-sql key on a table

    *grin* Ed did not want to ignite debate, but it was inevitable. I agree with Scott, creating a third column of meaningless data makes no sense, if a natural,...

  • RE: Help

    Richard, that's possible, but he didn't say that was the case. Really, a question like this allows for not much more than googling the error message or giving an...

  • RE: Urgent help need to create query

    I repeat. The first issue is not how complex this query will be to deal with how broken your table design is. Your first issue is, defining business...

  • RE: Urgent help need to create query

    "Please help me to generate a Select query which can determine all Daily Schedules for current Day which might fall in any of Schedule Type and Due_Day."

    "Schedule_Type can be Weekly,...

  • RE: Urgent help need to create query

    To start, here's SQL to create this data:

    CREATE TABLE file_list

    (

    file_ID int identity,

    file_status varchar(10),

    customer_name varchar(50),

    Direction varchar(3),

    First_Directory varchar(100),

    Original_filename varchar(150)

    )

    INSERT...

  • RE: Urgent help need to create query

    That last response is *insane*. The OP said they have no idea how to write SQL. The size of their database, is irrelevant.

Viewing 15 posts - 16 through 30 (of 57 total)