Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old April 25th, 2007, 08:54 AM
Registered User
Points: 1,897, Level: 17
Points: 1,897, Level: 17 Points: 1,897, Level: 17 Points: 1,897, Level: 17
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2005
Location: Mumbai, Maharastra, India.
Posts: 352
Thanks: 14
Thanked 0 Times in 0 Posts
Send a message via Yahoo to rupen
Default Query Problem.

any function in Query in Access to get month name e.g. 2/1/2007 should return to February,

and any function to concatenate string in Query (SQL Mode)?

Rupen Anjaria.:)
------------------
We CAN'T avoid problems, but can solve it.
  #2 (permalink)  
Old April 26th, 2007, 11:40 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

SQL supports DATENAME(), but Access ANSI SQL 89 does not support this. I suggest a select case function, like GetMonth()

Public sMonth As String
Function GetMonth(iMonth As Integer)
Select Case iMonth
    Case 1
    sMonth = "January"
    Case 2
    sMonth = "February"
    ...
End Select
GetMonth = sMonth
End Function

Then just call this from your code (but not your SQL... do it on a form or report Detail on format event.

Yes, just use the query designer and regular expressions in Field line. For example, if you have two names in your table called "LastName" and "FirstName" and you want to display them as one field LastName, FirstName, then in the field line of the query designer, do this:

FullName:([LastName] & ", " & [FirstName])

This will take this:

LastName FirstName
Smith John

And display it in the column as

FullName
Smith, John

Did that help?

mmcdonal
  #3 (permalink)  
Old April 27th, 2007, 07:04 AM
Friend of Wrox
Points: 4,007, Level: 26
Points: 4,007, Level: 26 Points: 4,007, Level: 26 Points: 4,007, Level: 26
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

What about just

Format(YourDateHere, "mmmm")

Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
  #4 (permalink)  
Old April 27th, 2007, 07:43 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Hey, what about that? I never knew about the MMMM format. I will have to go back and peruse that reference.


mmcdonal


Similar Threads
Thread Thread Starter Forum Replies Last Post
Query Problem bundersuk VB Databases Basics 0 December 30th, 2006 07:50 AM
query problem purnendu2311 Other Programming Languages 2 December 1st, 2006 02:53 PM
problem with query harpua Classic ASP Databases 1 January 24th, 2005 12:36 PM
Problem in query leo_vinay Classic ASP Databases 5 January 21st, 2005 06:32 AM
query problem mateenmohd SQL Server 2000 7 September 9th, 2003 11:58 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.