July 3, 2017 at 8:49 pm
Comments posted to this topic are about the item Independence Day
July 3, 2017 at 10:58 pm
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โ
July 4, 2017 at 12:16 am
Happy independence date to all in the US and all ex-pats! Thanks Steve.
...
July 4, 2017 at 1:48 am
Happy holiday Steve.
July 4, 2017 at 3:19 am
Was the 2016 in the second option a typo or deliberate ๐ I *almost* picked that one.
Happy holiday from the UK my American friends.
July 4, 2017 at 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.
Tom
July 4, 2017 at 3:21 am
TomThomson - Tuesday, July 4, 2017 3:20 AMThe 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.
July 4, 2017 at 4:53 am
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. ๐
LinkedIn: https://www.linkedin.com/in/sqlrv
Website: https://www.sqlrv.com
July 4, 2017 at 8:48 am
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:
July 5, 2017 at 7:40 am
TomThomson - Tuesday, July 4, 2017 3:20 AMThe 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
July 5, 2017 at 8:30 am
Some people signed on July 4, but all did not complete the signing until later.
July 5, 2017 at 6:55 pm
Nice question, Steve. I hope everyone had a great day, no matter where in the world they are.
July 5, 2017 at 6:56 pm
TomThomson - Tuesday, July 4, 2017 3:20 AMThe 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.
July 6, 2017 at 10:15 am
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.
July 7, 2017 at 9:39 am
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