sql - Sort Month+Year in VB.net using MS-ACCESS as db -


i using following query

select month(datee) [month], year(datee) [year] ledger_broker group month(datee),year(datee) 

output : output

what's query combine both columns , show as

1-2016 2-2016 

or

jan-2016 feb-2016 

use format() expression format month plus year wish. months digits, should work:

select distinct format(datee, 'm-yyyy') month_year ledger_broker order month(datee), year(datee); 

for abbreviated month names, adjust format pattern:

select distinct format(datee, 'mmm-yyyy') month_year 

Comments

Popular posts from this blog

java - pagination of xlsx file to XSSFworkbook using apache POI -

Unlimited choices in BASH case statement -

apache - How do I stop my index.php being run twice for every user -