Year Beginning Date

S

Scott

I want to run a YTD report that will return the first day (January 1) of the
same year of a date (ending date) that I manually enter on a form. If the
date is any month, any day of 2009 then I want the date 1/1/2009 returned.
If the month ending date is any date, any month of 2008 then I want the date
1/1/2008 returned. What is the formatting I would use to return January 1 of
the same year as a manually entered date on a form?
 
K

KARL DEWEY

In query design view scroll to righ to an empty spot in the Field row and
enter this using your actual field name --
qryYear: Format([YourDateField], "yyyy")

Under that in the Criteria row type in this using your form name and text
box ---
Format([Forms]![YourFormName]![YourTextBox], "yyyy")
 
D

Dale Fye

Scott,

I think what you are looking for is the DateSerial( ) function. Something
like:

StartDate: DateSerial(Year(form!yourForm.txtSomeDate), 1, 1)
 

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

Top