Forum Replies Created

Viewing 15 posts - 61 through 75 (of 105 total)

  • RE: User Count By the Half Hour

    It looks like he's building the summary for the time column from the UserCode and the time the user starts viewing the account (WorkStart). Judging from the row with zero...

  • RE: XML Query

    I'm sure there's a nice way to consolidate everthing throwing in some left joins and isnulls (maybe a union or two) but here's a quick example:

    Create Table #Employee(EmployeeID int, Employee_Name...
  • RE: Left Cross Join

    or then again you can always do a combination cross join and left join:

    SELECT a.x, t.y
    FROM a
    LEFT JOIN (SELECT x, y FROM a CROSS JOIN b) t ON a.x =...
  • RE: Single Quote Usage in Query

    To the eye, 'Won''t Fix' with two single quotes inside (the proper way to do it) appears to be 'Won"t Fix' with a double quote inside. but if we change...

  • RE: Combo Box Limited to 36000 records or so

    Do you still come across this limit when you populate the Row Source Type with a callback function?

    You could return a smaller chunk of the data but still have all...

  • RE: Date question

    No problem.

    Take a look at the third(?) option mentioned above.

    WHERE ecommerce.dbo.order_header.submitted_date >= @submitted_date
      and ecommerce.dbo.order_header.submitted_date < dateadd(d,1, @submitted_date)
    
  • RE: Date question

    If you want to stick to the current structure, you can do:

    WHERE convert(datetime, convert(varchar, ecommerce.dbo.order_header.submitted_date, 101)) = @submitted_date
    

    (there's probably a more elegant way of doing it that I'm blanking on

  • RE: Data Type Issue

    bigint is too small for his example.

  • RE: Top N question

    I think she means that she wants to get the last balance before the @as_of_date. Hopefully, there is just one entry per date (or we are dealing with a date...

  • RE: Conditional Order By?

    Ah... I didn't think about breaking it out like that.

    Still could get hard to manage as you add columns:

    order by
       case when @sort1_columncode=1 and @sort1_direction=1 then Title  
  • RE: using Count(*)

    Just curious...

    Any reason not to use the AVG aggregate?

    (Is SQL Server smart enough not to compute the Sum twice if it were used? It is still just the one scan...

  • RE: How to link a SyBase server from SQL Server?

    or maybe a trigger that checks for cross-posting users and inserts records in the private message table with the moderators' ids and a message consisting of a link to the...

  • RE: Conditional Order By?

    Take the easy way out, why don't ya?

    (sorry. that was wrong of me.
     there's always a chance the original poster didn't understand that first reply.)
  • RE: Conditional Order By?

    Something like this is also a possibility (and a mess):

    order by 
      case when @sort1_direction = 1 then 
          case  @sort1_columncode when 1...
  • RE: Case expressions error

    Check mine.

    I'm saying "Don't do that!".

    If you distribute the load correctly you can probably stay under 10.

    CASE WHEN (11=12) OR (12=13) THEN
        CASE WHEN (11=12) THEN 1111
    ...

Viewing 15 posts - 61 through 75 (of 105 total)