473,508 Members | 2,422 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Date criteria one year less than a specific date

1 New Member
I want to find all records greater than 12/31/"last year" for any year. For example, if I wanted 12/31/2010, I could use > #12/31/2011# - 365 to give me 12/31/2010. I cannot figure out how to do it for any given year.

Thanks for your help.
Jul 28 '11 #1
2 4667
Rabbit
12,516 Recognized Expert Moderator MVP
Just do greater than or equal to January first of the current year.
Expand|Select|Wrap|Line Numbers
  1. >= DateSerial(1, 1, Year(Date())
Jul 28 '11 #2
NeoPa
32,557 Recognized Expert Moderator MVP
If you specifically want a whole year from any given date then you can use :
Expand|Select|Wrap|Line Numbers
  1. ([DateField] Between DateAdd("yyyy", -1, {YourDate}) + 1 And {YourDate})
If however, you simply want to match all dates within a particular year then use :
Expand|Select|Wrap|Line Numbers
  1. (Year([DateField]) = Year({YourDate}))
Jul 28 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

11
4201
by: David B | last post by:
I have 2 querys with the following in the date criteria Between DateAdd("m",-6,(!!)) And (!!) Between DateAdd("m",-24,(!!)) And DateAdd("m",-6,(!!)) Problem is they both look at the same...
2
2127
by: Terry | last post by:
I have a database that I would like to query for a specific date range. I want to create a report based on this query that will pull any records from the last 7 days. Is this possible? Can...
1
19260
by: laredotornado | last post by:
Hello, Using PHP 4, how would i Extract the numeric month and year from a date variable created using the date() function? Thanks, - Dave
10
2367
by: kyosohma | last post by:
Hi, I am working on a timesheet application in which I need to to find the first pay period in a month that is entirely contained in that month to calculate vacation time. Below are some example...
9
3224
by: Millie18 | last post by:
Hi, I’m trying to set up a query to find all dates on or between a start and end date. Table name and field names I’ve used: Tbl_bookings Booking No Boarding Arrival Date Boarding Departure...
8
2766
by: Dr Al | last post by:
I have a table with four date fields, some of which may not be filled in based on our data entry needs. I have a criteria set as <date()-180 which is supposed to pull dates older than 180 days ago....
1
1557
by: zeusspandex | last post by:
Hi, i have the following SQL query and would like to add date criteria to it. the field being from the table and the criteria being Between !! And !! query: SELECT , ...
5
4821
by: sh55555 | last post by:
I have built a query in Access using the DateSerial function to convert dates such as 20100401 to 04/01/2010. The query results work fine and the date is displayed correctly. I am now trying to...
9
6213
by: Raza Zahur | last post by:
Hi all, I've googled and googled but I can google no more, so I am here to ask for help on an issue I am having. I have a macro that runs a series of queries. Before the macro can be run, the...
5
1851
by: David Biscan | last post by:
Hi, I struggle with my project big time... I am creating a database based on a car rental. I am trying to create a query where after entering a specific date, it will list all of the cars that...
0
7224
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7118
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7493
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5625
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4706
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3192
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3180
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1550
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
415
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.