P
patti
This is my first encounter w/ coding a sql update query.
Code:
================================
Option Compare Database
Option Explicit
Function UpdateFiscalCalendarDates()
Dim reportdate As Date
reportdate = DateAdd("d", -7, Date)
Dim strSQL As String
strSQL = "Update Master INNER JOIN DateTranslateTable ON
Master.TranDate=DateTranslateTable.CalendarDate " _
& "SET Master.[Month] = DateTranslateTable!CalendarMonth,
Master.FiscalMonth = DateTranslateTable!FiscalMonth " _
& "WHERE (((Master.Month) Is Null) AND ((Master.FiscalMonth) Is Null)
AND ((Master.TranDate)>=[reportdate]));"
Debug.Print strSQL
DoCmd.RunSQL strSQL
End Function
==================================
i am prompted for the reportdate. Can someone help me with the code?
thanks.
patti
Code:
================================
Option Compare Database
Option Explicit
Function UpdateFiscalCalendarDates()
Dim reportdate As Date
reportdate = DateAdd("d", -7, Date)
Dim strSQL As String
strSQL = "Update Master INNER JOIN DateTranslateTable ON
Master.TranDate=DateTranslateTable.CalendarDate " _
& "SET Master.[Month] = DateTranslateTable!CalendarMonth,
Master.FiscalMonth = DateTranslateTable!FiscalMonth " _
& "WHERE (((Master.Month) Is Null) AND ((Master.FiscalMonth) Is Null)
AND ((Master.TranDate)>=[reportdate]));"
Debug.Print strSQL
DoCmd.RunSQL strSQL
End Function
==================================
i am prompted for the reportdate. Can someone help me with the code?
thanks.
patti