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 January 25th, 2004, 10:34 AM
hawk1217 hawk1217 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 6 hawk1217 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Monthly Report

I'm trying to create a monthly report with totals of a particular value shown per month. I can get it all to work but the month is only showing as an integer (using the month function). Is there any in-built function to give me the name of the month rather than the number. I know in SQL server you can use MonthName but this doesn't work in access.
Any help appreciated.

Reply With Quote
  #2  
Old January 25th, 2004, 03:46 PM
TBÁrpi's Avatar
TBÁrpi TBÁrpi is offline
Lazy User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Hungary, Europe
Posts: 337 TBÁrpi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 h 5 m 5 sec
Reputation Power: 5
Send a message via MSN to TBÁrpi Send a message via Yahoo to TBÁrpi Send a message via Skype to TBÁrpi
I could not find a function so I use my own:

Public Function GetMonthName(MonthNum As Byte, Optional LongName As Boolean = True) As String
Dim s As String
Dim MonthNames(23) As String
MonthNames(0) = "January"
MonthNames(1) = "February"
MonthNames(2) = "March"
MonthNames(3) = "April"
MonthNames(4) = "May"
MonthNames(5) = "June"
MonthNames(6) = "July"
MonthNames(7) = "August"
MonthNames(8) = "September"
MonthNames(9) = "October"
MonthNames(10) = "November"
MonthNames(11) = "December"
MonthNames(12) = "Jan."
MonthNames(13) = "Feb."
MonthNames(14) = "Mar."
MonthNames(15) = "Apr."
MonthNames(16) = "May."
MonthNames(17) = "Jun."
MonthNames(18) = "Jul."
MonthNames(19) = "Aug."
MonthNames(20) = "Sep."
MonthNames(21) = "Oct."
MonthNames(22) = "Nov."
MonthNames(23) = "Dec."
If MonthNum >= 1 And MonthNum <= 12 Then
If Not LongName Then
MonthNum = MonthNum + 11
Else
MonthNum = MonthNum - 1
End If
s = MonthNames(MonthNum)
Else
s = "Argument must be between 1 and 12."
End If
GetMonthName = s
End Function
__________________
BRegs,
TBÁrpi
"I can only show you the door. You're the one who has to walk through it."

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft Access Help > Monthly Report


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 2 hosted by Hostway