Solved

DateAdd returns 12/30/1899

Posted on 2008-10-23
7
259 Views
Last Modified: 2013-11-29
I have a date field that needs to be updated.  I created a query with criteria that my field [StartDate] is = or < date() -365.  This returns only the records that are 1 year or older. I then used the query to make thae form.  What I'm trying to do is increase that [StartDate] by 1 year on the form.  I am using a macro set the value, and the value I'm using is:  DateAdd("yyyy",1,[StartDate]), but I get the 1230/1899 date.  What am I doing wrong?
0
Comment
Question by:cebaker75
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
7 Comments
 
LVL 92

Assisted Solution

by:Patrick Matthews
Patrick Matthews earned 250 total points
ID: 22786821
What was the original value in StartDate?
0
 

Author Comment

by:cebaker75
ID: 22787583
"10/22/2007" is the date I am testing.  I've changed my query criteria to DateAdd, thinking it was a format issue, but I get the same result.  I should be getting "10/22/2008", at least that's what I want to get.
0
 
LVL 92

Assisted Solution

by:Patrick Matthews
Patrick Matthews earned 250 total points
ID: 22787605
Ok.  What data type are you using for StartDate?
0
Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 250 total points
ID: 22787755
can you post the content of your macro
0
 

Author Comment

by:cebaker75
ID: 22787774
Date/Time
0
 

Author Comment

by:cebaker75
ID: 22788052
Well, nevermind.  I copied my setvalue formlua from the macro that wasn't working into a new macro (copy and paste) and it now works???  I have no idea why it didn't work in the first macro, it was the only item in the macro.
0
 

Author Comment

by:cebaker75
ID: 22788060
Thanks to all!
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question