Datepart function

N

Newbie_Sashi

I used the datepart function to obtain the month from the field "Transaction
date" . The month is stored in a field called "Month" and the format applied
to this field is mmmm. However, the Month field always defaults to January.
Please help!!!
 
D

Dennis

Having a field called 'Month' is a bad idea because that is a reserved word.
Also why use the Datepart and then Format, you can simply use this in the
control source of your field.
=Format([Transaction Date],"mmmm")
 
N

Newbie_Sashi

You're great. It really helped, but I need the result to be captured in the
"Month" field in the table. By doing what you have recommended, the form
displays the month as desired, but this is not getting captured in the table.
Please help.

Dennis said:
Having a field called 'Month' is a bad idea because that is a reserved word.
Also why use the Datepart and then Format, you can simply use this in the
control source of your field.
=Format([Transaction Date],"mmmm")

Newbie_Sashi said:
I used the datepart function to obtain the month from the field "Transaction
date" . The month is stored in a field called "Month" and the format applied
to this field is mmmm. However, the Month field always defaults to January.
Please help!!!
 
D

Douglas J. Steele

If there's already a field Transaction Date in the table, you shouldn't be
storing the month as well.

Create a query, and add the month as a calculated field. Use the query
wherever you would otherwise have used the table.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Newbie_Sashi said:
You're great. It really helped, but I need the result to be captured in
the
"Month" field in the table. By doing what you have recommended, the form
displays the month as desired, but this is not getting captured in the
table.
Please help.

Dennis said:
Having a field called 'Month' is a bad idea because that is a reserved
word.
Also why use the Datepart and then Format, you can simply use this in the
control source of your field.
=Format([Transaction Date],"mmmm")

Newbie_Sashi said:
I used the datepart function to obtain the month from the field
"Transaction
date" . The month is stored in a field called "Month" and the format
applied
to this field is mmmm. However, the Month field always defaults to
January.
Please help!!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Label Visibility 4
Ato generated control number 1
datepart function 2
Format DatePart 4
Datepart function 11
Date field revisited 4
Excel Vba to change displayed year automatically. 14
DatePart in default value 3

Top