Home sql Data on date via Datediff and DatePart in SQL

Data on date via Datediff and DatePart in SQL

Author

Date

Category

You need to withdraw data for those who already have 18 years since the system date. I can’t make the correct counting on the day. That is, if a person was born 2001.06.20, then he still does not have 18.


Answer 1, Authority 100%

select * from dbo.thetators_2
Whater
Readers_2. Data_night & lt; = DateADD (YEAR, -18, GetDate ())

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions