That's one way of doing it....



  • Found this awesome nugget buried in a do-it-all query that I clearly didn't give a crap about:
    [code]
    ...
    (f.description='Weekly' and datediff(d,'1/4/2003',getDate())%7 = 0) --so weekly part works on Saturday dates only
    ...
    [/code]

    :facepalm:

    <inb4 everyone says use datepart you fool> <inb4 everyone else says your dbms is crap anyway, here's how you do it in X other dbms>

  • Winner of the 2016 Presidential Election

    :doing_it_wrong:



  • To be fair, if there wasn't a specific function to get the day of the week, this seems like the best method. And it should work as long as they don't change the days of the week.


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.