Modifying Date Range

  • Thread starter pushrodengine via AccessMonster.com
  • Start date
P

pushrodengine via AccessMonster.com

I need to modify the expression:

Between [Forms].[frmReport].[StartDate] And [Forms].[frmReport].[EndDate]


Is there a way to modify the expression above so that:

[StartDate] mm/dd/yyyy

mm=01, dd =01, and yyyy= one year earlier

and

[EndDate] mm/dd/yyyy

mm= the month entered, dd= the day entered, and yyyy= one year earlier

A date is entered into [StartDate] and [EndDate] from the form “frmReport†in
the format of mm/dd/yyyy.


Thanks
 
F

fredg

I need to modify the expression:

Between [Forms].[frmReport].[StartDate] And [Forms].[frmReport].[EndDate]

Is there a way to modify the expression above so that:

[StartDate] mm/dd/yyyy

mm=01, dd =01, and yyyy= one year earlier

and

[EndDate] mm/dd/yyyy

mm= the month entered, dd= the day entered, and yyyy= one year earlier

A date is entered into [StartDate] and [EndDate] from the form ´frmReport¡ in
the format of mm/dd/yyyy.

Thanks

Wouldn't it be simpler to just enter the correct month and year wanted
directly in the form's StartDate and EndDate text boxes?

Anyway, try:
Between DateSerial(Year([forms]![frmReport]![StartDate])-1,1,1) And
DateAdd("yyyy",-1,[forms]![frmReport]![EndDate])

Enter 4/18/1007 and 7/15/2007 and you should get records between
1/1/2006 and 7/15/2006.
 
P

pushrodengine via AccessMonster.com

Works Great!
I also need to modify the expression again, but this time I need:

[StartDate] mm/dd/yyyy

mm=01, dd =01, and yyyy= the year entered

and

[EndDate] mm/dd/yyyy

mm= the month entered, dd= the day entered, and yyyy= the year entered


Thanks Again
 
J

John W. Vinson

Works Great!
I also need to modify the expression again, but this time I need:

[StartDate] mm/dd/yyyy

mm=01, dd =01, and yyyy= the year entered

and

[EndDate] mm/dd/yyyy

mm= the month entered, dd= the day entered, and yyyy= the year entered


Thanks Again

Ummm...

that's exactly and precisely what Fred's expression gives you. Did you try it?

John W. Vinson [MVP]
 

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

Similar Threads


Top