Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Database Design / January 2005

Tip: Looking for answers? Try searching our database.

Field Data Validation: Date Range

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Stuart - 06 Jan 2005 16:49 GMT
Hi All,

I've been trying to figure out the syntax to stick in a Validation Rule for
a date field. The hardcoded dates work ( >= #01/01/2005# and <= #01/31/2005#
), but I need a floating 30 day buffer. Like ">= date and <= date+30".

I've been trying different ways for an hour now, and I know it can't be as
difficult as I'm making it.

Thanks for any help!
Stuart - 06 Jan 2005 18:29 GMT
Found it:

"Between date() And date() + 30"

> Hi All,
>
[quoted text clipped - 6 lines]
>
> Thanks for any help!
John Vinson - 06 Jan 2005 18:46 GMT
>Hi All,
>
[quoted text clipped - 6 lines]
>
>Thanks for any help!

Try

BETWEEN Date() AND DateAdd("d", 30, Date())

or

>= Date() AND <= Date() + 30

I think the parentheses are necessary or Access will think you're
comparing to a text string "date".

                 John W. Vinson[MVP]
Tim Ferguson - 07 Jan 2005 17:52 GMT
>  >= Date() AND <= Date() + 30
>
> I think the parentheses are necessary or Access will think you're
> comparing to a text string "date".

This works for me. One thing strikes me, though: what will Access do when
the clock ticks over and the record becomes invalid without being updated?

I just have a feeling that this rule should be implemented as either a
constraint on a data-entry control (rather than a table field), or else as
a query.

Just a thought

Tim F
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.