query reformat

E

equisbert

Hello,
It's been several years since last time I used access and I'm a bit
rusty...I have a table which has several "date" (mmddyy) fields, when
querying it, I would like to transform the date field to "mm" is this
possible? How? Thanks
 
F

fredg

Hello,
It's been several years since last time I used access and I'm a bit
rusty...I have a table which has several "date" (mmddyy) fields, when
querying it, I would like to transform the date field to "mm" is this
possible? How? Thanks

Don't know what you mean by 'transform' the date field.
Dates are stored as the number of days from 12/30/1899.
Today's date is stored as 39051.
You can 'display' the date in many ways.
To display the date as a 2 digit month, set the format property of the
field to:
mm

In a query, you can use"
MonthOfDateField:Format([DateField],"mm")

This MonthOfDateField is no longer a date but a Text value.
The original [DateField] value is still a date.
 
E

equisbert

Thanks for the response, that's what I thought the solution to be,
although I'm getting this error: compile error. in query expression
'Format([dateplanned],"mm")

when trying to convert the datenewdate: Format([dateplanned],"mm")

could it be because I'm missing a library or file?
Hello,
It's been several years since last time I used access and I'm a bit
rusty...I have a table which has several "date" (mmddyy) fields, when
querying it, I would like to transform the date field to "mm" is this
possible? How? Thanks

Don't know what you mean by 'transform' the date field.
Dates are stored as the number of days from 12/30/1899.
Today's date is stored as 39051.
You can 'display' the date in many ways.
To display the date as a 2 digit month, set the format property of the
field to:
mm

In a query, you can use"
MonthOfDateField:Format([DateField],"mm")

This MonthOfDateField is no longer a date but a Text value.
The original [DateField] value is still a date.
 
F

fredg

Thanks for the response, that's what I thought the solution to be,
although I'm getting this error: compile error. in query expression
'Format([dateplanned],"mm")

when trying to convert the datenewdate: Format([dateplanned],"mm")

could it be because I'm missing a library or file?
Hello,
It's been several years since last time I used access and I'm a bit
rusty...I have a table which has several "date" (mmddyy) fields, when
querying it, I would like to transform the date field to "mm" is this
possible? How? Thanks

Don't know what you mean by 'transform' the date field.
Dates are stored as the number of days from 12/30/1899.
Today's date is stored as 39051.
You can 'display' the date in many ways.
To display the date as a 2 digit month, set the format property of the
field to:
mm

In a query, you can use"
MonthOfDateField:Format([DateField],"mm")

This MonthOfDateField is no longer a date but a Text value.
The original [DateField] value is still a date.

Most likely a reference.

Open any module in Design view (or click Ctrl + G).
On the Tools menu, click References.
Click to clear the check box for the type library or object library
marked as "Missing:."

An alternative to removing the reference is to restore the referenced
file to the path specified in the References dialog box. If the
referenced file is in a new location, clear the "Missing:" reference
and create a new reference to the file in its new folder.

See Microsoft KnowledgeBase articles:
283115 'ACC2002: References That You Must Set When You Work with
Microsoft Access'
Or for Access 97:
175484 'References to Set When Working With Microsoft Access' for
the correct ones needed,
and
160870 'VBA Functions Break in Database with Missing References' for
how to reset a missing one.

For even more information, see
http://www.accessmvp.com/djsteele/AccessReferenceErrors.html
 

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


Top