|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
update year in date field
I have an Access database where I am trying to update just the Year of a field that is Date/Time type (DATEFIELD) but keep balance of date (its a Y2K repair).
I have tried : Update TABLENAME Set Year(DATEFIELD)=2003 WHERE Year([DATEFIELD])=1903 So if the current value is 12/1/1903 I would like it to be updated to 12/1/2003 |
|
#2
|
|||
|
|||
|
Code:
update TABLENAME set [DATEFIELD] = CDate( Format$([DATEFIELD], "MM/DD/") & "2003" ) where Year([DATEFIELD]) = 1903 |
|
#3
|
|||
|
|||
|
Thanks, that looks like that will do the trick. Really appreciate it, was stumped. LS
|
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > update year in date field |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|