Microsoft Access Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft Access Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old February 9th, 2004, 01:57 AM
susan susan is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 69 susan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Cool how to extract

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.

Reply With Quote
  #2  
Old February 9th, 2004, 02:28 PM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 12
SELECT Month([DateTable]![DateField]) AS [Month]
FROM DateTable
GROUP BY Month([DateTable]![DateField]);

Reply With Quote
  #3  
Old February 9th, 2004, 06:31 PM
susan susan is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 69 susan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Thank you Baxter it works.
How if i want Month and Year without DAY

Reply With Quote
  #4  
Old February 9th, 2004, 11:43 PM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 12
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.

Reply With Quote
  #5  
Old February 10th, 2004, 12:03 AM
susan susan is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 69 susan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 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.

Reply With Quote
  #6  
Old February 10th, 2004, 12:23 AM
susan susan is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 69 susan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Thumbs up

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.

Reply With Quote
  #7  
Old February 10th, 2004, 09:33 AM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 12
I edited my previous posting

S-

Reply With Quote
  #8  
Old February 10th, 2004, 06:28 PM
susan susan is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 69 susan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Thank you , it works !

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft Access Help > how to extract


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway