all dates with month greater than equal current month

  • Thread starter Thread starter tlyczko
  • Start date Start date
T

tlyczko

I'm trying to pull Access data for a web page.

I want a query that will pull all dates for the current month plus all
future dates.

For example, December 2006 onward to January or February 2007...

I've tried DatePart with Month but that only gives me December...

How do I write the query criteria for this month plus all future
months??

Thank you, :) tom
 
tlyczko said:
I'm trying to pull Access data for a web page.

I want a query that will pull all dates for the current month plus all
future dates.

For example, December 2006 onward to January or February 2007...

I've tried DatePart with Month but that only gives me December...

How do I write the query criteria for this month plus all future
months??

Thank you, :) tom

SELECT *
FROM TableName
WHERE DateField >= DateSerial(Year(Date()), Month(Date()), 1)
 
I'm trying to pull Access data for a web page.

I want a query that will pull all dates for the current month plus all
future dates.

For example, December 2006 onward to January or February 2007...

I've tried DatePart with Month but that only gives me December...

To return the first and last time granules of the month for a given
date/time e.g. current date/time (note the smallest time granule in
Access/Jet is one second):

SELECT
DATEADD('M', DATEDIFF('M', #1990-01-01 00:00:00#, NOW()), #1990-01-01
00:00:00#) AS start_date,
DATEADD('M', DATEDIFF('M', #1990-01-01 00:00:00#, NOW()), #1990-01-31
23:59:59#) AS end_date

Jamie.

--
 
Back
Top