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

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -