Need a little "DatePart" help

chef_tim

Registered User.
Local time
Today, 08:03
Joined
Dec 16, 2004
Messages
77
Hi all, First time poster, so be gentle....LOL. I'm trying to get the DatePart expression to return the "mmm", all I can get it to do is give me the digit of the month ie 1 for Jan. If I use 3m's I get #errors or #name! . I know this is probably something simple, but I'm relatively new to this. Almost all of the knowledge I have so far has come from "MS Access For Idiots". I'd appriciate any help at all. Thanks, Tim
 
Firstly, Welcome.

Secondly, where/how are you trying to use the expression? In a Report? Query? VB?
 
For right now I will have it display in a form. At a later time it will go into a report.

This is what I have been using so far =DatePart("m",[DOB]) DOB=date of birth field. This returns a digit. When I try to use =DatePart"mmm",[DOB]) is where I get errors. Thanks, Tim
 
Why not just put the 'mmm' in the format field, rather than use the datepart function.
 
Thanks for the quick help Ray. There are more then one control that will use the birth month (mmm) so I just want to put in their Birthdays once, and have the month taken out of that field. I hope I'm making sense with this. Tim
 
Are you using a Label or TextBox for this date?
Where are you putting the DatePart expression?
try replacing DatePart("mmm",field) with Format(field,"mmm")
 
Date

chef-tim,

=DatePart"m",[DOB]) is the right syntax, it gives you the number of the Month.

If you try to get the name of the Month or an abbrevetaion of the Month you can use some simple code to get the resutl.
 
It is in a text box on my form. If I use the Format(field"mmm") how would I make it take the date from the DOB field??? See I told you I'm very new to this stuff :) Thanks, Tim
 
In the Control Source use [DOB], then use mmm in the format field section as per my orginal suggestion.
 
Thank you, thank you, thank you!!!!!!! That did it, I used the \'mmm\' and it returns 'Jan' Woo Hoo!!!! (as you might be able to tell, I excite very easily) Thanks so much, bett you'll be seeing me here quite a bit, Tim
 

Users who are viewing this thread

Back
Top Bottom