A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Date query



 
 
Thread Tools Display Modes
  #1  
Old October 25th, 2009, 09:06 PM posted to microsoft.public.access.queries
Dudley
external usenet poster
 
Posts: 68
Default Date query

Is it possible to create a query field which will yield the last day of the
month in the year following a specified date? For example if the date is
(British style) 25/10/2009, I would like 31 October 2010.

Thanks for any help.
Dudley
  #2  
Old October 25th, 2009, 10:01 PM posted to microsoft.public.access.queries
Rick Brandt
external usenet poster
 
Posts: 4,354
Default Date query

On Sun, 25 Oct 2009 14:06:01 -0700, Dudley wrote:

Is it possible to create a query field which will yield the last day of
the month in the year following a specified date? For example if the
date is (British style) 25/10/2009, I would like 31 October 2010.

Thanks for any help.
Dudley


DateSerial(Year(YourSpecifiedDate)+1, Month(YourSpecifiedDate)+1,0)



--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
  #3  
Old October 25th, 2009, 10:15 PM posted to microsoft.public.access.queries
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Date query

On Sun, 25 Oct 2009 14:06:01 -0700, Dudley
wrote:

Is it possible to create a query field which will yield the last day of the
month in the year following a specified date? For example if the date is
(British style) 25/10/2009, I would like 31 October 2010.

Thanks for any help.
Dudley


Yes:

DateSerial(Year([specifieddate]), Month([specifieddate]) + 1, 0)

The zeroth day of next month is the last day of this month...
--

John W. Vinson [MVP]
  #4  
Old October 25th, 2009, 11:18 PM posted to microsoft.public.access.queries
Dudley
external usenet poster
 
Posts: 68
Default Date query

Just what I need. Thanks very much to Rick and John.
Dudley

"John W. Vinson" wrote:

On Sun, 25 Oct 2009 14:06:01 -0700, Dudley
wrote:

Is it possible to create a query field which will yield the last day of the
month in the year following a specified date? For example if the date is
(British style) 25/10/2009, I would like 31 October 2010.

Thanks for any help.
Dudley


Yes:

DateSerial(Year([specifieddate]), Month([specifieddate]) + 1, 0)

The zeroth day of next month is the last day of this month...
--

John W. Vinson [MVP]
.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:13 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.