0

Possible Duplicate:
ms-access built in function Month(number)

In one of my queries I have the following function.

DateSerial(Date(),[Roster]![DOH],[Roster]![DOH])

When I invoke the query I receive an overflow error. What am I doning wrong?

Community
  • 1
  • 1
Desert Spider
  • 744
  • 1
  • 13
  • 31
  • The users Date of hire. stored in a linked table as Date/Time with an input mask of 99/99/0000;0; – Desert Spider Dec 21 '12 at 15:04
  • 1
    DateSerial(integer,integer between 1 and 12, integer between 1 and 31) **not** DateSerial(date,date,date). We went through this and I posted a link to the MS help page. – Fionnuala Dec 21 '12 at 15:17
  • I used the link and must not have properly understood the material. I will review again. Thanks, – Desert Spider Dec 21 '12 at 15:19
  • That previous question was about `Month()`; this one is about `DateSerial()`. Calling them duplicates seems overly aggressive with your close vote. – HansUp Dec 21 '12 at 17:03
  • While the question may have a different title, the subject matter is identical. From your previous vehement defence of your stance, I thought you did not wish to have people answer poor and duplicate questions. – Fionnuala Dec 21 '12 at 18:01
  • @HansUp I tend to agree but I think the both questions might just be *I don't understand how DateSerial works somebody help* and Remou's last answer should have been sufficient. – Conrad Frix Dec 22 '12 at 23:58

1 Answers1

1

So if [DOH] is date of hire and you want the anniversary in the current year, use this:

DateSerial(Year(Date()), Month([Roster]![DOH]), Day([Roster]![DOH]))
HansUp
  • 95,961
  • 11
  • 77
  • 135