AlaSQL / alasql

AlaSQL.js - JavaScript SQL database for browser and Node.js. Handles both traditional relational tables and nested JSON data (NoSQL). Export, store, and import data from localStorage, IndexedDB, or Excel.
http://alasql.org
MIT License
7.02k stars 654 forks source link

Add date function to get current date without time component #1936

Closed paulrutter closed 2 months ago

paulrutter commented 3 months ago

Please introduce a function to get the current date without time component, so this is no longer needed:

DATE(YEAR(NOW()) + '-' + MONTH(NOW()) + '-' + DAY(NOW()))

See https://www.w3schools.com/sql/func_mysql_curdate.asp for example.

paulrutter commented 3 months ago

https://github.com/AlaSQL/alasql/pull/1937

paulrutter commented 3 months ago

Naming of the function is up for debate.

paulrutter commented 3 months ago

https://github.com/AlaSQL/alasql/blob/ca7ecb4d38a5810d22d05ea7eac7f60f7f10ba75/src/alasqlparser.jison#L110 probably needs updating as well.

paulrutter commented 2 months ago

Fixed in https://github.com/AlaSQL/alasql/pull/1937