Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Doctor Doom
Starting Member
12 Posts |
Posted - 2004-04-01 : 09:57:31
|
Hi, friends,I have a problem here with an UPDATE query in ms Access:I have a column in a table with dates of this year (from 1 january until 31 december).I want to change only the year of each cell.1 january 2004-->1 january 20052 january 2004-->2 january 20053 january 2004-->3 january 2005and so on.In the UPDATE query, I put: Year([date_column])+1This doesn't seem to work. Neither do other formulas. I get the next:28 june 190528 june 190528 june 1905and so onI don't know where Access gets this from. I also looked in the Help manual of Access for the right formulas for dates, but I couldn't find a useful thing.Can anyone help?Thanks in advance |
|
samsekar
Constraint Violating Yak Guru
437 Posts |
Posted - 2004-04-01 : 10:04:20
|
HTH..Select dateadd('yyyy', 1, '01/01/2003')- Sekar |
 |
|
Doctor Doom
Starting Member
12 Posts |
Posted - 2004-04-01 : 11:34:10
|
Hi, Sekar,I've tried your code, but I always get a syntax error. I've looked for syntaxes on the Net, but I can't see anything wrong in the code a put: DateAdd('yyyy',1,'01/01/2004')The cursor jumps always at the same place after the error message: right on the first comma: DateAdd('yyyy',1,'01/01/2004')Do you know what I'm doing wrong here? |
 |
|
Doctor Doom
Starting Member
12 Posts |
Posted - 2004-04-01 : 11:57:48
|
I've got it now, Sekar.I don't know why Access keeps playing with me...The right syntax was:dateadd('yyyy';2;'01/01/2003') instead ofdateadd('yyyy',2,'01/01/2003')Very frustrating indeed, especially when all the tutorials on the Net use the first one.Thanks again! |
 |
|
|
|
|
|
|