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 / Modules / DAO / VBA / March 2007

Tip: Looking for answers? Try searching our database.

Date() function

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
PLD - 27 Feb 2007 00:14 GMT
Access 2000 SP3

When I use the date() as a default in a date field for default I get an
error when I save the table.  Unknown function'Date' in validation expression
or default value in <table name>. Any ideas???
Damian S - 27 Feb 2007 00:56 GMT
Hi PLD,

In the table default value, you need to use =Date() not Date() for the
default value

Damian.

> Access 2000 SP3
>
> When I use the date() as a default in a date field for default I get an
> error when I save the table.  Unknown function'Date' in validation expression
> or default value in <table name>. Any ideas???
Arvin Meyer [MVP] - 27 Feb 2007 01:30 GMT
Actually, either works fine.
Signature

Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

> Hi PLD,
>
[quoted text clipped - 9 lines]
>> expression
>> or default value in <table name>. Any ideas???
Damian S - 27 Feb 2007 03:13 GMT
Fair point...  should have been the parentheses...  ;-)

D.

> Actually, either works fine.
> > Hi PLD,
[quoted text clipped - 10 lines]
> >> expression
> >> or default value in <table name>. Any ideas???
Arvin Meyer [MVP] - 27 Feb 2007 01:33 GMT
> Access 2000 SP3
>
> When I use the date() as a default in a date field for default I get an
> error when I save the table.  Unknown function'Date' in validation
> expression
> or default value in <table name>. Any ideas???

You probably have a missing reference. Open any code window and choose:

Tools >>> References

Then look for any references marked as "MISSING" Click the browse button to
find the correct one, and the try compiling your code. If the code compiles
your errors will stop.
Signature

Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

PLD - 27 Feb 2007 03:22 GMT
YES! that is the problem. DTCINT 1.0 Type Library is missing. I got this
project from another person and I search my system and I do not have this. Is
there a place I can get it?

> > Access 2000 SP3
> >
[quoted text clipped - 10 lines]
> find the correct one, and the try compiling your code. If the code compiles
> your errors will stop.
Douglas J. Steele - 27 Feb 2007 15:33 GMT
Do you really need it? Try removing the reference (i.e. unchecking it), then
compiling your application (on the Debug menu when you're in the VB Editor).
If it compiles cleanly, you likely didn't need the reference in the first
place.

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)

> YES! that is the problem. DTCINT 1.0 Type Library is missing. I got this
> project from another person and I search my system and I do not have this.
[quoted text clipped - 17 lines]
>> compiles
>> your errors will stop.
Arvin Meyer [MVP] - 03 Mar 2007 02:53 GMT
I'm not sure if you saw the other answers, so let me give you mine. If that
type library is required to run this application, you'll probably need to
get it from whomever gave you the application. If not just uncheck the
missing reference, and choose Debug >>> Compile All Modules from the menu.
You can easily find out by making a copy of your database and uncecking the
reference, then recompiling. If it squalks, you'll need the reference.
Signature

Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

> YES! that is the problem. DTCINT 1.0 Type Library is missing. I got this
> project from another person and I search my system and I do not have this.
[quoted text clipped - 17 lines]
>> compiles
>> your errors will stop.
Marshall Barton - 27 Feb 2007 01:44 GMT
>Access 2000 SP3
>
>When I use the date() as a default in a date field for default I get an
>error when I save the table.  Unknown function'Date' in validation expression
>or default value in <table name>.

Whenever you use a function anywhere except in a VBA
procedure, you must include the parenthesis e.g.  Date()

Signature

Marsh
MVP [MS Access]

onedaywhen - 27 Feb 2007 11:36 GMT
> Whenever you use a function anywhere except in a VBA
> procedure, you must include the parenthesis e.g.  Date()

I thought DATE() was the exception rather than the rule and I assumed
this is because DATE without brackets is a synonym for DATETIME e.g. I
can see why the parser may have problems with

CREATE TABLE Test (date_col DATE DEFAULT DATE NOT NULL)

All the other niladic scalar functions supported natively by Jet I can
think of (both of them <g>) work without brackets:

CREATE TABLE Test (
date_col DATETIME DEFAULT NOW NOT NULL
)
;
SELECT RND
;

(not that RND is of any use in Jet, though).

Jamie.

--
 
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.