Forum Replies Created

Viewing 15 posts - 271 through 285 (of 1,217 total)

  • RE: Transform from other DB structure

    Please look at these data you provided for the result:

    select 111 as emp_no, '2005-05-04' as dtrdate, '2007-05-03 07:22:58' as login, '2007-05-04 12:00:07' as logout

    I suppose there is a typo and...

  • RE: Transform from other DB structure

    I didn't mean to use unique ID. The tables would be joined on emp_no and sequence_no, where the sequence always start from 1 for each employee - that means only...

  • RE: Transform from other DB structure

    Can it be that some user will log in twice without logging off in between? In other words, is the sequence of dtrtag for each user 0-1-0-1-0-1-0-1 etc., and does...

  • RE: Insert one row in one table and multiple rows on a second table inside transaction

    "The second insert will insert many rows corresponding to the rows in the excel file. (threrefore the second stored procedure will have to be called many times)."

    Why? You can call...

  • RE: Script to compare two tables

    To compare without knowing what you are comparing doesn't make sense. You could try to look whether two tables are identical, but if the column names are different, then you...

  • RE: comparing date columns in two tables

    Adrian meant that you should post something like

    CREATE TABLE table_a (aid int IDENTITY, some_date DATETIME....)

    CREATE TABLE table_b (bid int IDENTITY, aid INT, another_date DATETIME....)

    table_b.aid is Foreign key to table_a...

  • RE: Aggregate - Group by ?

    Yeah, that's the real life 🙂 you have to work with what you've got.

    Well, did you manage to get at the required result from what polecat posted? If not, let...

  • RE: Parentheses within a quote

    Could you tell us how it was solved? It may help other people later when they have the same or similar problem... and, of course, we are curious, too 🙂

  • RE: aggregate query question

    mrpolecat,

    unfortunately you have typo either in the data or in the desired result. For example, Customer number 2 has PrimaryStore 1, but in result you wish to display Store 2....

  • RE: Using top to display records

    Anubhav,

    one of the TOP is not necessary. You can limit the output first, and then just order.

    SELECT *

    FROM (select top 2 * from order by date desc) as...

  • RE: CASE in WHERE Clause

    You might also wish to post your entire query and explain how it is used and for what. There is a good chance that the SQL can be rewritten for...

  • RE: Parentheses within a quote

    Did you copy and paste the name of company into your query?

    Remember that your query looks for the precise value, which can be different from what you see. If...

  • RE: Aggregate - Group by ?

    It is a pity that your original table (I mean the one at the very beginning) isn't a bit more normalized... if you'd have columns Area_name and Area_status instead of...

  • RE: Trigger not getting values from INSERTED

    Maybe not as long as you are using the application. Some applications are written to do everything row by row (which is terrible... I should know that, the application we...

  • RE: date

    No idea. You should first specify what the numbers in your INT column mean. The numbers you posted can mean anything - and I doubt anyone here has a functional...

Viewing 15 posts - 271 through 285 (of 1,217 total)