Skip to content
Advertisement

sql query selecting birthday today from number format

Let say i have identification card number in this format

JavaScript

we can convert the number to birthday by using this code

JavaScript

how do i select all user that is having birthday today ? is this possible ?

JavaScript

Advertisement

Answer

What I understand is first 6 digits of your ic is YYMMDD. If this is not the case please ignore. Accordingly you need this conversion in sql.

JavaScript

please update ‘Substring(YEAR(NOW()),-2)’ with your $max, 2 digit year.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement