r/SQL • u/Substantial-Book2534 • Sep 25 '26
Discussion Using DateAdd for timestamps
I am making updates to some older reports and come across this line (or similar) often:
DateAdd(hh, 0, GetDate())
Why do you do that? Is there a legitimate reason why you couldn’t just write GetDate()?
7
Upvotes
View all comments
Show parent comment
4
u/Malfuncti0n Sep 25 '26
If 1=1 makes much sense if you are debugging or building in blocks, so you can quickly skip over large parts just by changing the If instead of commenting the entire thing out.