?
Solved

DateAdd returns 12/30/1899

Posted on 2008-10-23
7
Medium Priority
?
269 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 93

Assisted Solution

by:Patrick Matthews
Patrick Matthews earned 1000 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 93

Assisted Solution

by:Patrick Matthews
Patrick Matthews earned 1000 total points
ID: 22787605
Ok.  What data type are you using for StartDate?
0
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 1000 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

762 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