Using just the Year as Criteria For Long Date field

N

Noel

Hi. I want to be able to select a set of records, in a
query, by saying "give me all the records that have the
year 2003 in the date in this field". The field specified
is a Date/Time field, set to Long Date in the Table. What
would the queries criteria look like? Also, if this is
possible, what would the criteria look like if I wanted
to specify the year by using a DLookup like

=DLookUp("[PlacementStartYear]","[tblPlacementStartYear]")

Thanks, Noel
 
P

Pavel Romashkin

Perhaps

Year([PlacementStartYear]) = 2003
=DLookUp("Year([PlacementStartYear])","[tblPlacementStartYear]", 2003)

I am not positive DLookup will be happy but its an easy try.
Pavel
 
C

Cheryl Fischer

Noel,

Just create a calculated field by placing the following in the Field: row
of your query

Year([MyDateField])

In the Criteria: row, enter a number corresponding to the desired year.
 
N

Noel

Thanks Pavel. I realsied that I posted this by mistake in
Getting Started and reposted it in Queries before I saw
your reply. I'll give your suggestion a try tomorrow and
will get back to you. Thanks again for the quick reply,
Noel
-----Original Message-----
Perhaps

Year([PlacementStartYear]) = 2003
=DLookUp("Year
([PlacementStartYear])","[tblPlacementStartYear]", 2003)
I am not positive DLookup will be happy but its an easy try.
Pavel
Hi. I want to be able to select a set of records, in a
query, by saying "give me all the records that have the
year 2003 in the date in this field". The field specified
is a Date/Time field, set to Long Date in the Table. What
would the queries criteria look like? Also, if this is
possible, what would the criteria look like if I wanted
to specify the year by using a DLookup like

=DLookUp ("[PlacementStartYear]","[tblPlacementStartYear]")

Thanks, Noel
.
 
N

Noel

Thank You. Cheers, Noel
-----Original Message-----
Noel,

Just create a calculated field by placing the following in the Field: row
of your query

Year([MyDateField])

In the Criteria: row, enter a number corresponding to the desired year.

--

Cheryl Fischer, MVP Microsoft Access
Law/Sys Associates, Houston, TX


Hi. I want to be able to select a set of records, in a
query, by saying "give me all the records that have the
year 2003 in the date in this field". The field specified
is a Date/Time field, set to Long Date in the Table. What
would the queries criteria look like? Also, if this is
possible, what would the criteria look like if I wanted
to specify the year by using a DLookup like

=DLookUp ("[PlacementStartYear]","[tblPlacementStartYear]")

Thanks, Noel


.
 

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