Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TODAY() Function Simple Question

Status
Not open for further replies.

backer

Technical User
Apr 13, 2001
24
US
Please tell me why, when I enter the expression below, I get an error and dialog box which says Enter Parameter Value for today(). I have also tried Date() and Now().

DaysHeldDWT: IIf([Date_from_DWT] Is Null,[today()]-[Date_to_DWT],[Date_from_DWT]-[Date_to_DWT])
 
Should read:

DaysHeldDWT: IIf([Date_from_DWT] Is Null,Today()-[Date_to_DWT],[Date_from_DWT]-[Date_to_DWT])

instead of:

DaysHeldDWT: IIf([Date_from_DWT] Is Null,[today()]-[Date_to_DWT],[Date_from_DWT]-[Date_to_DWT])

Notice the removal of the brackets ([]) from around the Today() If we knew what it was we were doing, it would not be called research, would it? - Albert Einstein [atom]

Robert L. Johnson III, A+, Network+, MCP
Access Developer/Programmer
robert.l.johnson.iii@citigroup.com
 
Thnks for the quick response, but making the change your recommended gives me the following error

Undefined function 'today' in expression.

Could it be my TODAY function is somehow fouled up in ACCESS?
 
Try using Date() instead of Today() If we knew what it was we were doing, it would not be called research, would it? - Albert Einstein [atom]

Robert L. Johnson III, A+, Network+, MCP
Access Developer/Programmer
robert.l.johnson.iii@citigroup.com
 
Same problem usind Date and Now. It still says Enter Parameter Value.

Any more suggestions?
 
Open up a module (any module), click tools -> references and see if any are labeled as MISSING:

If so, you will need to relocate that referecne and all should be well.

You also may want to try:

DaysHeldDWT: IIf(IsNull([Date_from_DWT]),Date()-[Date_to_DWT],[Date_from_DWT]-[Date_to_DWT])

Notice the If part of the clause.....IsNull(something) instead of something Is Null

If we knew what it was we were doing, it would not be called research, would it? - Albert Einstein [atom]

Robert L. Johnson III, A+, Network+, MCP
Access Developer/Programmer
robert.l.johnson.iii@citigroup.com
 
Thanks a lot - your suggestion worked.

For future reference I checked a module and see that I have many available refrences but only a few boxes are checked and I didn't see any MISSING. Would a MISSING show up as a separate box checked/not checked?
 
MISSING: would appear before the name of any checked box that Access could not locate....this is how you can tell is something was not found...

So, if you have:

[X] Microsoft DAO 3.51 Objects

And Access couldn't locate the reference file at startup, it would look like:

[X] MISSING: Microsoft DAO 3.51 Obkects If we knew what it was we were doing, it would not be called research, would it? - Albert Einstein [atom]

Robert L. Johnson III, A+, Network+, MCP
Access Developer/Programmer
robert.l.johnson.iii@citigroup.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top