?
Solved

Add date to update field

Posted on 2011-10-26
3
Medium Priority
?
415 Views
Last Modified: 2012-05-12
I am using a passthru query to update a local Access table, I need to include date modified.

What is the proper syntax to pass the date?

Karen
Set adoConn = New ADODB.Connection
    adoConn.Open sConn
    Set adoRS = New ADODB.Recordset
        CurrentDb.Execute "Delete * from tblFTCS_vw"
        Set rs = New ADODB.Recordset
        strSQL = "Select * from tblFTCS_VW"
        rs.Open strSQL, cn, adOpenDynamic, adLockOptimistic
'>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>        
        strSQL = "SELECT FTEM_ID, EQPT_NAME, NOMEN_MODIFIER_NAME, SERVICE_ORGN_CODE as LabNo, MFR_NAME, MFR_NO, Date()" & _
                " FROM FTCSPROD.FTEM_VI_VW" & _
                " Where (SERVICE_ORGN_CODE Is Not Null)"
'>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
        adoRS.Open strSQL, adoConn, adOpenStatic, adLockPessimistic
        'Recreates the temp table with FTCS data.
     
        Do Until adoRS.EOF
            rs.AddNew
                For j = 0 To adoRS.Fields.Count - 1
                    rs(j) = Nz(adoRS(j))
                Next j
            rs.Update
            adoRS.MoveNext
        Loop

Open in new window

0
Comment
Question by:Karen Schaefer
  • 2
3 Comments
 
LVL 78

Accepted Solution

by:
slightwv (䄆 Netminder) earned 2000 total points
ID: 37032159
You are selecting from an Oracle table want the current date of the database server?

that is sysdate:  strSQL = "SELECT ..., sysdate

To create a specific format:  to_char(sysdate,'MM/DD/YYYY') as mydate

If not, just use the local date in access.
0
 

Author Closing Comment

by:Karen Schaefer
ID: 37032223
thanks that did the trick.
0
 
LVL 78

Expert Comment

by:slightwv (䄆 Netminder)
ID: 37032236
Glad to help.
0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question