2012-03-30 4 views

Répondre

1

En sqlite Vous ne pouvez pas obtenir le nom du mois mais vous obtiendrez le numéro du mois comme 01-Jan, 02-Fév etc. Vous devez convertir ce nombre en mois par code.

strftime('%m', dateField) 

Vous obtiendrez le numéro du mois. Et en utilisant cas ou imbriqué si la condition, vous pouvez imprimer le nom du mois.

0

Essayez cette

SELECT gauche (datename (mois, DATEADD (MM, -1, getdate())), 3)

2

dateField est la date:

select case strftime('%m', dateField) when '01' then 'January' when '02' then 'Febuary' when '03' then 'March' when '04' then 'April' when '05' then 'May' when '06' then 'June' when '07' then 'July' when '08' then 'August' when '09' then 'September' when '10' then 'October' when '11' then 'November' when '12' then 'December' else '' end 
as month 
Questions connexes