r/SQL • • 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

19 comments sorted by

View all comments

Show parent comment

1

u/Eleventhousand Sep 25 '26

Hey there. I didn't berate OP at all. If it came off that way even in the slightest, then I apologize to /u/Substantial-Book2534 . OP asked for plausible scenarios, I offered some, but suggested that its best to ask the code writer (same time of thing I would tell my team members).

As far as your involvement, do you tend to do this type of thing a lot? I see that you received several downvotes in r/dcl the other day because you accused a fellow Redditor of trying to self validate when they offered a helpful reply to someone else. You then imagined a scenario in which they would hide from themselves, and spend 10 minutes every other week, and 25 minutes redoing reservations or something.

0

u/BigMikeInAustin Sep 25 '26

If you are going to track me around reddit and bring other conversation into different communities, could you please at least read it?

1

u/Eleventhousand Sep 25 '26

How about this instead: Please just leave me alone. I obviously didn't berate OP. I am a genuinely nice person, and I enjoy helping folks. I helped numerous Redditors with SQL 1 on 1 and have done mock interviews with them. I deserve at least the baseline level of respect that you'd give to a stranger.

0

u/BigMikeInAustin Sep 25 '26

Wow, you went through 3 days of comments to find something to try to intimidate me about.