SQL make existing date into today.. maybe?

MackMan

Registered User.
Local time
Today, 06:18
Joined
Nov 25, 2014
Messages
174
Hi Everyone.

I've been using Allen Browns method http://allenbrowne.com/ser-57.html to copy form and sub form data, and it works perfectly after some adaptation.

It changes dates to today from whatever the date 'was'.. perfect....
however, as I'm still learning SQL, is there a way, to make the copied subform's date into today as well... this is my adapted code from the SQL part...

Code:
             'Duplicate the related records: append query.
           If Forms!FRMREGISTERMain!frmJustSubRecordsDEPOSITS.Form.RecordsetClone.RecordCount > 0 Then
                strSql = "INSERT INTO [tblSplits] ( TopLineID, [B][I][COLOR=red]TransDate[/COLOR][/I][/B], Memo, Category, SubCategory, Credit, Debit) " & _
                    "SELECT " & lngID & " As NewID, [B][I][COLOR=red]TransDate[/COLOR][/I][/B], Memo, Category, SubCategory, Credit, Debit " & _
                    "FROM [tblSplits] WHERE TopLineID = " & Me.TopLineID & ";"
                DBEngine(0)(0).Execute strSql, dbFailOnError
            Else
                MsgBox "Main Transaction has been Copied, but as this is not a Split, there was no other details."
           End If
As I'm still learning, am I right in thinking that I'll use SELECT and/or WHERE somewhere in there?

As always, many thanks!
 
In the SELECT clause, try changing TransDate to Date()
 
Sometimes, its the most obvious things that's right in front of you.

Thank you.:)
 

Users who are viewing this thread

Back
Top Bottom