Change Date values in a Recordset Coulmn 
Author Message
 Change Date values in a Recordset Coulmn

HI,

Need to convert Date in "Datemodified" Column of the recordset(RsCSV)
         Example date 11/30/1901  need to change to 11/30/2001
                     There is only 2 values like this that need changed
(Just the YEAR needs to be changed)
                                   1901 to 2001 and 1902 to 2002

   I guess I need to loop through the recordset? And how do I change the
value in
the recordset?

 'Modify data in Recordset
     RsCSV.MoveFirst

     Do Until RsCSV.EOF

               RsCSV("Datemodified") = ?

      Loop

Thanks for any help
GV



Mon, 17 Jan 2005 23:35:27 GMT  
 Change Date values in a Recordset Coulmn
You could use the DateAdd function and add 100 years to the date if the year
is < 1903

RsCSV("Datemodified") = DateAdd("yyyy",100,RsCSV("Datemodified") )

-David


Quote:
> HI,

> Need to convert Date in "Datemodified" Column of the recordset(RsCSV)
>          Example date 11/30/1901  need to change to 11/30/2001
>                      There is only 2 values like this that need changed
> (Just the YEAR needs to be changed)
>                                    1901 to 2001 and 1902 to 2002

>    I guess I need to loop through the recordset? And how do I change the
> value in
> the recordset?

>  'Modify data in Recordset
>      RsCSV.MoveFirst

>      Do Until RsCSV.EOF

>                RsCSV("Datemodified") = ?

>       Loop

> Thanks for any help
> GV



Tue, 18 Jan 2005 04:24:32 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. cannot get the Date value from DAO recordset

2. Changes to Display values w/o changing database values

3. Recordset value changes with .update

4. When value changes, update other field with current date

5. Changing values in a recordset

6. ADO Recordset changing date format

7. ADO Recordset changing date format

8. Need paperclip icon in Outlook on coulmn header

9. Datagrid calulated coulmn

10. combining a time and a date to one Date/Time value

11. Null date values in Date/Time fields in Access DB

12. adodb connection to excel: recordset.fields(i).value=null for fields with numeric value

 

 
Powered by phpBB® Forum Software