Forum Replies Created

Viewing 15 posts - 46 through 60 (of 105 total)

  • RE: Stripping HTML tags from data

    I think that's just meant to be some strange gremlin emoticon.

  • RE: HOW TO FIND OUT DATE OF BIRTH FROM THE TABLE

    May be a governmental agency if they have the TIME of birth on file.

    That would explain the quantity...

  • RE: HOW TO FIND OUT DATE OF BIRTH FROM THE TABLE

    a) Gather the appropriate names and ages(temporary table)

       declare @tomorrow datetime
       select @tomorrow = dateadd(d, 1, getdate())
       select emp_name, YearsOld=datediff(yyyy, emp_dob, @tomorrow+1)  --...
  • RE: Join Question

    True. If you're not going to use my final recommendation, NOT EXISTS is probably the way to go.

    I wouldn't be surprised if SQL Server optimized all three (NOT IN, NOT...

  • RE: Join Question

    There's many ways to structure it...

    In the WHERE clause, you can do:

    where not InspectionID in (Select InspectionID from ClerkCitations)
      and not InspectionID in (Select InspectionID from OutletCitations)

    or you could...

  • RE: ''''''''Complex'''''''' statements to work out churn

    It's definitely possible.

    If all else fails, you can always fall back on cursors or loops.

    Here's an attempt at a set-based approach:

    declare @UserActivity table(UserID int, WorkDate datetime)
    insert into @UserActivity
    select 1, '12/01/2005...
  • RE: need help in Stored Procedure (Time Striping)

    There are many ways.

    Here are a couple:

    declare @MyDateAndTime datetime
    select @MyDateAndTime = getdate()
    select dateadd(d, 0, datediff(day, 0, @MyDateAndTime))
    select convert(datetime, convert(char(8), @MyDateAndTime, 112))

    Sorry. I just quickly scanned your post. That will give...

  • RE: counting days

    It's probably a computed column.

    In Enterprise Manager, find the table, go to Design Table, and check out the formula property for the column in question.

  • RE: Views referencing views (problem)

    Still... why should the results fluctuate on him?

    (Assuming all conditions are the same and they're not dependent on something variable like getdate)

    If he's simply doing a Select he shouldn't have...

  • RE: Removing the Sum & group by

    All good points.

  • RE: Removing the Sum & group by

    I know.

    I just meant that reading the original code annoyed me so much I pretty much gave up on it.

    You may have managed to salvage it but I was beyond...

  • RE: Removing the Sum & group by

    All this is giving me a headache.

    Must be the lack of parentheses separating the ANDs from the ORs.

    I'm not even going to try to read the previous posts. Here's ANOTHER...

  • RE: SELECT where consecutive dates

    How about this way?

    (Of course, I am assuming there's only the one entry per day)

    declare @MachineDtl table([Date] datetime, 
               ...
  • RE: Removing the Sum & group by

    You can probably cut them out and try a SELECT DISTINCT, instead.

    actually, you could probably just remove the SUM(...) part, if you wanted.

    It IS very confusing...

  • RE: Need Help Sorting

    I'm not sure what you mean by the commas but you should probably look into the ParseName function.

Viewing 15 posts - 46 through 60 (of 105 total)