473,503 Members | 12,383 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Datediff error

1 New Member
Hi,

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:

#error

Please help.

Thank you.
Dec 16 '11 #1
3 1812
sierra7
446 Recognized Expert Contributor
Hi
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.)

S7
Dec 16 '11 #2
TheSmileyCoder
2,322 Recognized Expert Moderator Top Contributor
Try
Expand|Select|Wrap|Line Numbers
  1. =DateDiff("m";[EffectiveDate];Date())
Is this written directly in the controlsource of the control?
Dec 16 '11 #3
NeoPa
32,557 Recognized Expert Moderator MVP
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

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

Similar topics

2
7135
by: News Central | last post by:
To all! I use the DateDiff function using VB6 and get this error 'Wrong number of argument or invalid property assignment' ... have anyone seen this problem? thanks ....
8
5917
by: inamori | last post by:
I face that problems 07/01/2003 06/30/2006 ---------> it should be 3 01/01/2003 02/28/2005 --------->could i get 2 years and 2 months 01/01/2003 03/01/2005 ...
4
12131
by: John Smith | last post by:
Hi, I'm having trouble working out the best way of calculating the time difference between two times on the same day. The example I have found does return the hours (in this case 8) but forgets...
4
11904
by: Paolo | last post by:
I am having some problem with a Year Function. I have form on which I have 4 field which indicate dates and an additional form which sums those dates: These are the fields: YEARS...
1
2257
by: mik18 | last post by:
I have an Access app on a PC using Office XP and everything works fine. I installed this on a PC using Office 2003 and the DateDiff function is not recognized. Is there a reference file that is...
3
3328
by: T23Ij9 | last post by:
Hi. I have 3 seperate date fields. InitialDate InspDate ReportDate I am trying to setup several unbound Text boxes in a form that will give me days elapsed between these dates. These text...
1
256
by: bbawa1 | last post by:
Again thanks a lot but When I execute only this portion it gives me error Syntax error converting the varchar value '2d 0h 0m' to a column of data type int. My stored procedure is the...
1
1185
by: cmrhema | last post by:
Hi, I want to retrieve the values from store_geofence table where the timeduration exceeds certain interval the procedure is as below CREATE procedure . @regno nvarchar(50), @frmdate...
2
2746
by: muddasirmunir | last post by:
i am using vb 6 , i had place two datepicker in form now i want to calcuate differcen of month in two date for this i used the function datediff i had try it withh many syntax but getting error...
1
1455
by: james2432 | last post by:
Parse error: syntax error, unexpected T_VARIABLE in /var/www/LukeSite/validateform.php on line 27 validateform.php <?php session_start(); if(empty($_SESSION)||!isset($_SESSION)){...
0
7212
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7098
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7296
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7364
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7470
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5604
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4696
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3174
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
751
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.