Independence Day

  • Comments posted to this topic are about the item Independence Day

  • Nice one, thanks Steve
    To all our US colleagues, enjoy your festivities today.

    ____________________________________________
    Space, the final frontier? not any more...
    All limits henceforth are self-imposed.
    โ€œlibera tute vulgaris exโ€

  • Happy independence date to all in the US and all ex-pats! Thanks Steve.

    ...

  • Happy holiday Steve.

  • Was the 2016 in the second option a typo or deliberate ๐Ÿ˜‰  I *almost* picked that one.
    Happy holiday from the UK my American friends.

  • The use of "dw" fooled me - I thought that would either result in a number between 0 and 6 since there are only 7 days of the week or be an invalid parameter, so that none of the answers was correct - but it turns out that in datediff "dw" is treated as if it were "day" of "d", instead of meaning weekday as it does when used with the datepart function.  This is nowhere documented for datediff (it is documented for dateadd).  I thought I was guessing which of the last two options were errors. 

    I think anyone using "dw" in datediff  (or in dateadd for that matter) is being silly, given what it means in datepart it's going to confuse people.

    Tom

  • TomThomson - Tuesday, July 4, 2017 3:20 AM

    The use of "dw" fooled me - I thought that would either result in a number between 0 and 6 since there are only 7 days of the week or be an invalid parameter, so that none of the answers was correct - but it turns out that in datediff "dw" is treated as if it were "day" of "d", instead of meaning weekday as it does when used with the datepart function.  This is nowhere documented for datediff (it is documented for dateadd).  I thought I was guessing which of the last two options were errors. 

    I think anyone using "dw" in datediff  (or in dateadd for that matter) is being silly, given what it means in datepart.  And I think it's silly that it's allowed in dateadd and datediff with a different meaning that it has in datepart.

    Fooled me too.

  • Agreed, the use of "dw" threw me off as well for the very same reason and I picked the only one that had "day" without noticing the order of the dates. ๐Ÿ™

  • Good one, thanks Steve and happy holiday. I didn't expect that the DATEDIFF function can also use the abbreviations dw or just w as a day datepart.:rolleyes:

  • TomThomson - Tuesday, July 4, 2017 3:20 AM

    The use of "dw" fooled me - I thought that would either result in a number between 0 and 6 since there are only 7 days of the week or be an invalid parameter, so that none of the answers was correct - but it turns out that in datediff "dw" is treated as if it were "day" of "d", instead of meaning weekday as it does when used with the datepart function.  This is nowhere documented for datediff (it is documented for dateadd).  I thought I was guessing which of the last two options were errors. 

    I think anyone using "dw" in datediff  (or in dateadd for that matter) is being silly, given what it means in datepart it's going to confuse people.

    Fooled me as well.  However, the "correct" answer is still incorrect as the Declaration of Independence was not signed until Aug 2, 1776.
    https://en.wikipedia.org/wiki/Signing_of_the_United_States_Declaration_of_Independence

  • Some people signed on July 4, but all did not complete the signing until later.

  • Nice question, Steve.  I hope everyone had a great day, no matter where in the world they are.

  • TomThomson - Tuesday, July 4, 2017 3:20 AM

    The use of "dw" fooled me - I thought that would either result in a number between 0 and 6 since there are only 7 days of the week or be an invalid parameter, so that none of the answers was correct - but it turns out that in datediff "dw" is treated as if it were "day" of "d", instead of meaning weekday as it does when used with the datepart function.  This is nowhere documented for datediff (it is documented for dateadd).  I thought I was guessing which of the last two options were errors. 

    I think anyone using "dw" in datediff  (or in dateadd for that matter) is being silly, given what it means in datepart it's going to confuse people.

    I don't mean to start a debate here because I know some people who really know the abbreviations really well.  I, however, use the longer syntax because I've been burned by them myself.

  • I don't know why I use dw. Old habit. I'll try to stick to the longer syntax in the future as a better example.

  • The actual signing date was August 2, 1776 but points taken.

Viewing 15 posts - 1 through 15 (of 17 total)

You must be logged in to reply to this topic. Login to reply