jiblankman
Registered User.
- Local time
- Today, 04:23
- Joined
- May 27, 2008
- Messages
- 43
I am having two problems with the Date function. I am using Access 2003. Hopefully someone has some idea what happened and can help.
First problem:
I have a table and need to add a column with the current date. The following has worked perfectly for 2 years, until today:
Yesterday, the DateSelected was "5/22/2012". When I run the code now, I get a date of "12:00:09 AM".:banghead: Last time I checked, that was 9 seconds after midnight not a date.
Second problem:
This appears to be related, but I don't have a clue why. I have a field in a report with the following
Yesterday, I got "May 2012". Today, it is "#Name?".:banghead:
There is a dent in my wall and my head is starting to hurt. Anyone have an idea how to fix this? I am sure that the answer if completely obvious but I can't figure it out. Help please!
First problem:
I have a table and need to add a column with the current date. The following has worked perfectly for 2 years, until today:
Code:
CurrentDb.Execute ("ALTER TABLE [Selections] ADD COLUMN [DateSelected] DATE;")
CurrentDb.Execute ("UPDATE [Selections] SET [DateSelected]= " & Date & ";")
Yesterday, the DateSelected was "5/22/2012". When I run the code now, I get a date of "12:00:09 AM".:banghead: Last time I checked, that was 9 seconds after midnight not a date.
Second problem:
This appears to be related, but I don't have a clue why. I have a field in a report with the following
Code:
=Format(DateSerial(Year(Date()),Month(Date()),Day(Date())),"mmmm yyyy")
Yesterday, I got "May 2012". Today, it is "#Name?".:banghead:
There is a dent in my wall and my head is starting to hurt. Anyone have an idea how to fix this? I am sure that the answer if completely obvious but I can't figure it out. Help please!