By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,294 Members | 2,681 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,294 IT Pros & Developers. It's quick & easy.

Datediff error

P: 1

I use this function,
Expand|Select|Wrap|Line Numbers
  1. =DateDiff("m",[EffectiveDate],Date())
in a form but when I go in view mode it comes ou with the message in the box:


Please help.

Thank you.
Dec 16 '11 #1
Share this Question
Share on Google+
3 Replies

Expert 100+
P: 446
I think the square brakets are bugging it.

What is being set equal to the date difference (i.e. display the result in a MsgBox and see if it give the right result.)

Dec 16 '11 #2

Expert Mod 100+
P: 2,321
Expand|Select|Wrap|Line Numbers
  1. =DateDiff("m";[EffectiveDate];Date())
Is this written directly in the controlsource of the control?
Dec 16 '11 #3

Expert Mod 15k+
P: 31,494
The format of the command is fine if you have a field called "EffectiveDate" available in your bound recordset which contains a valid date. This error could occur if :
  1. There is no current record.
  2. There is no date in the specified field.
  3. There is no such specified field.

PS. In Denmark the characters used for list separation etc are different so Smiley's use of the semi-colon (;) is not incorrect, just localised.
Dec 16 '11 #4

Post your reply

Sign in to post your reply or Sign up for a free account.