|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
hi,can someone tell me the SQL code on how to extract just the month (mm) in a date column (mm/dd/yyyy) and group by month??
thank you. |
|
#2
|
|||
|
|||
|
SELECT Month([DateTable]![DateField]) AS [Month]
FROM DateTable GROUP BY Month([DateTable]![DateField]); |
|
#3
|
|||
|
|||
|
Thank you Baxter it works.
How if i want Month and Year without DAY |
|
#4
|
|||
|
|||
|
This should work, I havent tested it though
SELECT Format(Month([DateTable]![DateField]),"00") & Year([DateTable]![DateField]) AS [MonthYear] FROM DateTable GROUP BY (Format(Month([DateTable]![DateField]),"00") & Year([DateTable]![DateField])); S- Last edited by sbaxter : February 10th, 2004 at 09:33 AM. |
|
#5
|
|||
|
|||
|
S, thanks a lot, u're a great help.
am going to test this now. also thank u for the Form that you did - wtih DAO. appreciate it a lot. |
|
#6
|
|||
|
|||
|
i tried it, unfortunately it doesnt work.
just want to check, tblsection is the date column, right? what is SLASTCHANGE? is it a field, or do i just leave it as it is. THANk u. |
|
#7
|
|||
|
|||
|
I edited my previous posting
S- |
|
#8
|
|||
|
|||
|
Thank you , it works !
![]() |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft Access Help > how to extract |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|