sql - How to compare with date in mm/yy format in MySQL? -


i have column named 'exp_date' , date mm/yy. i.e: 07/17. want select rows exp_date less or equal 2 months remaining today. how can this?

you need post sql dialect using. assume sql92. cast function first step: cast('20' || substring (exp_date,4,2) || '/' || substring (exp_date, 1,2) date). mssql uses '+ instead of ||. after that, compare current_date - interval '1 month'. caps here optional.


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -