Forum Replies Created

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

  • RE: Using Date Param

    Whenever possible, you should avoid putting 'functions' in the 'WHERE' clause. Things like 'convert', 'datediff', 'upper', etc.

    It isn't a problem for small datasets, but can be for large datasets....

    If it was easy, everybody would be doing it!;)

  • RE: GETDATE

    SteveH2455 (4/3/2008)


    I have the following syntax within a cursor - (getdate() - getutcdate()) as date_Time,

    Have you looked at what this returns...

    select getdate()

    select getutcdate()

    select getdate() - getutcdate()

    Execute that in Query...

    If it was easy, everybody would be doing it!;)

  • RE: Largest Unit

    Geeeshhh...stop whining already...

    This was a fun question that made you think and do some research.

    Don't make more out of it than that. If missing the question ruined your day,...

    If it was easy, everybody would be doing it!;)

  • RE: Using Date Param

    Very good point...

    This is why many people use...

    where somedate >= '04/01/2008' --target date

    and somedate < '04/02/2008' --target date + 1

    to get all records that...

    If it was easy, everybody would be doing it!;)

  • RE: SELECT * and subtract a couple of fields?!

    OK, I'm feeling stupid here...

    I knew the script 'select' was there, but for some dumb reason, I have been scripting the 'create' lately. Its as if I totally forgot...

    If it was easy, everybody would be doing it!;)

  • RE: SELECT * and subtract a couple of fields?!

    If I need a 'select' that has a lot of columns, I'll script out the source table 'create', then manually edit out the extra stuff.

    Deleting the extra is...

    If it was easy, everybody would be doing it!;)

  • RE: Using Date Param

    bill.humphrey (4/2/2008)


    set @start_date = '24/07/2007 00:00:00'

    I don't believe you need to add the time when setting your start_date, as that is implied...

    '24/07/2007 00:00:00' = '24/07/2007' (when datatyped as datetime)

    The...

    If it was easy, everybody would be doing it!;)

  • RE: Using Date Param

    Does the datetime field in the database have a time component? Or is the time 00:00.

    If the time is not 00:00, you won't get a match.

    [Edit: it won't...

    If it was easy, everybody would be doing it!;)

  • RE: Using Date Param

    bill.humphrey (4/2/2008)


    where (dbo.cadcasedetails.dt_arrive is not null)

    and (priority_text = 'A')

    and (dbo.cadcasedetails.report_date = @start_date)

    order by timediff asc

    If you are not getting an error and just getting no records, check that...

    If it was easy, everybody would be doing it!;)

  • RE: ORDER BY

    Shaun McGuile (4/1/2008)


    SQL server 2000 is flawed and SQL server 2005 (mode 80) is flawed.

    Mode 90 SQL2005 implements SQL correctly therfore the correct answer is (d)!

    I run a query in...

    If it was easy, everybody would be doing it!;)

  • RE: ORDER BY

    Since no version specified, I thought that wasn't an issue...WRONG!

    This was a good exercise as it pointed out something that wasn't obvious.

    I'm working on SQL 2000 right now...

    If it was easy, everybody would be doing it!;)

  • RE: The March Car Update

    Steve, I really enjoy reading your editorials about non-computer subjects and hearing about life on the farm and other things like your Prius update.

    I live in a banking...

    If it was easy, everybody would be doing it!;)

  • RE: SET ANSI_WARNINGS OFF

    I'm not 100% positive, but I think SET ANSI_WARNINGS ON can go INSIDE the stored procedure (after the CREATE), so that when the SP runs, it sets ANSI_WARNINGS ON for...

    If it was easy, everybody would be doing it!;)

  • RE: Problems updating inserted row from within cursor

    AVB (3/25/2008)


    SET @LineItemBody = '"LI' +'","'+ --Record ID

    .....

    IF isnull(@LineItembody,'') = '' --Line Item Body will be null if an Order Number doesn't have any rows in the transaction tables...

    If it was easy, everybody would be doing it!;)

  • RE: Problems updating inserted row from within cursor

    You can still use the stored procs to return the data, I was saying build a function to parse out a comma-delimited string, such as containing multiple Order Numbers.

    For...

    If it was easy, everybody would be doing it!;)

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