Expression changes (97 to 2000 version)

  • Thread starter Thread starter Mervyn Gould
  • Start date Start date
M

Mervyn Gould

Table has three fields "weekno","stdate","endate". last
two are time date format. Query to find the weekno from
todays date. In access97 the code in the criteria field
was "Between date()+1 and date()+7". This expression does
not work when we run the application on Access2000. The
Access help is a little confusing making reference
to "date" should be changed to "now". Substituting "now"
in place of "date" does not work. Can you help us get this
working correctly in Access2000.
 
What do you get? or not get?
Is there an error message?

Which field are you using as criteria?

If it's [stDate] (or [endate]) then
Between Date() +1 And Date() +7
should work (No quote marks).

Unless the fields contain a Date and Time (9/16/2003 08:30:00 AM)
Now() is NOT the correct function to use.
Now() contains a Time value and will return incorrect records
by not including tomorrows records which will have a time value
of 00:00:00 AM, which will be before todays current Time.

Perhaps your computer is not recognizing Date(),
in which case you have a missing reference.
Open any module in Design view.
On the Tools menu, click References.
Click to clear the check box for the type library or object library
marked as "Missing:."

An alternative to removing the reference is to restore the referenced
file to the path specified in the References dialog box. If the
referenced file is in a new location, clear the "Missing:" reference
and create a new reference to the file in its new folder.

See Microsoft KnowledgeBase articles:
283115 'ACC2002: References That You Must Set When You Work with Microsoft
Access'
Or for Access 97:
175484 'References to Set When Working With Microsoft Access' for
the correct ones needed,
and
160870 'VBA Functions Break in Database with Missing References' for
how to reset a missing one.
 
Back
Top