Datepart function

  • Thread starter Thread starter Newbie_Sashi
  • Start date Start date
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!!!
 
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")
 
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!!!
 
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!!!
 
Back
Top